Skip to content

Instantly share code, notes, and snippets.

@msauza
Last active March 10, 2020 20:39
Show Gist options
  • Save msauza/278f4bb50f33b6c882a93d3f1d017110 to your computer and use it in GitHub Desktop.
Save msauza/278f4bb50f33b6c882a93d3f1d017110 to your computer and use it in GitHub Desktop.
Docker commands
### List running containers
docker ps
### List all containers
docker ps -a
### List successfully stopped containers
docker ps -f "status=exited"
### Stop all containers
docker stop $(docker ps -a -q)
### Remove all containers
docker rm $(docker ps -a -q)
### List all images
docker images ls
### Remove all images
docker rmi $(docker images -a -q)
### Prune unused Docker objects
docker system prune
### https://docs.docker.com/engine/reference/commandline/docker/
### https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
### https://docs.docker.com/config/pruning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment