Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@larvata
Created March 5, 2017 08:09
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 larvata/51a17713e569f847fffa258d33c3ad40 to your computer and use it in GitHub Desktop.
Save larvata/51a17713e569f847fffa258d33c3ad40 to your computer and use it in GitHub Desktop.
my docker cheat sheet

docker cheatsheet

  1. Remove all stopped containers
docker container prune
  1. Remove all dangling images
# list
docker images -f dangling=true

# remove
docker rmi $(docker images -f dangling=true -q)

  1. Build image in current folder
docker build --tag <image_name> . 
  1. Run an image and remove container after exit(--rm)
docker run --rm -it <image_name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment