Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Docker command tricks

Remove ALL containers

docker rm -f $(docker ps -a -q)

Remove ALL images

docker rmi $(docker images -q)

Remove dangling docker images

docker images -qf dangling=true | xargs docker rmi

Bind docker.sock to access docker commands from inside a container

docker run -v /var/run/docker.sock:/container/path/docker.sock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment