Docker Cheat Sheet

Listing Objects

DescriptionCommand
List running containers docker ps
List all containers docker ps --all
List images docker images
DescriptionCommand
Show the logging information that you would have seen if the container was attached docker logs
Follow the logging on the container w/o attaching docker logs -f
Attach to a detached container docker attach
Show files that have changed since the container started docker diff {Container ID/Name}
Findout what port docker is exposing a container's port on docker port {Container ID/Name} {Port}

Deleting Objects

DescriptionCommand
Delete container docker rm {Container ID/Name}
Delete all containers docker rm $(docker ps -a -q)
Delete image docker rmi {Image ID}
Delete all images docker rmi $(docker images -q)