Docker cheatsheet

Deleting or clearing out the docker system altogether, this will remove all containers, network, etc:

docker system prune

Get a list of all docker containers

docker container ls

Attaching to a container, this is useful if you have a web server you’re running and want to watch the standard output. I use this for rails server and with byebug I can debug (you can use container ID or container name but it’s easier to use container name):

docker attach [container_name]