Skip to content

Instantly share code, notes, and snippets.

@kentwait
Last active February 23, 2017 09:44
Show Gist options
  • Save kentwait/00408dd40a3b8eefe18ca7886a30a3d3 to your computer and use it in GitHub Desktop.
Save kentwait/00408dd40a3b8eefe18ca7886a30a3d3 to your computer and use it in GitHub Desktop.
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