Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?

Docker useful commands

Stop and remove all running containers:
docker stop $(docker ps -aq) && docker rm $(docker ps -aq)

Remove all stopped containers:
docker rm $(docker ps -aq)

Remove untagged/dangling/<none> images
docker rmi $(docker images -q -f dangling=true)

#Install utilities
Install ping (Ubuntu)
apt-get install iputils-ping

Install nslookup (Debian, Ubuntu)
apt-get install dnsutils

#See also
Docker Cleanup Commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment