Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Last active May 16, 2022 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/9b5a26ba44c8abf852adadbd22d5377b to your computer and use it in GitHub Desktop.
Save Shelob9/9b5a26ba44c8abf852adadbd22d5377b to your computer and use it in GitHub Desktop.
# create webserver called webserver
docker run --detach --publish 80:80 --name webserver nginx
## http://blog.baudson.de/blog/stop-and-remove-all-docker-containers-and-images##
#List all containers (only IDs)
docker ps -aq
#Stop all running containers
docker stop $(docker ps -aq)
#Remove all containers
docker rm $(docker ps -aq)
#Remove all images
docker rmi $(docker images -q)
docker kill $(docker ps -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment