Skip to content

Instantly share code, notes, and snippets.

@android10
Last active February 15, 2019 10:47
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 android10/99be42fbd793a25311e9090e4f964d9d to your computer and use it in GitHub Desktop.
Save android10/99be42fbd793a25311e9090e4f964d9d to your computer and use it in GitHub Desktop.
Docker useful commands

Stop all running containers.

docker stop $(docker ps -a -q)

Removes one or more images.

docker rmi my_image

Removes one or more images (with force).

docker rmi -f my_image

Kill all running containers.

kill $(docker ps -q)

Delete all stopped containers.

docker rm $(docker ps -a -q)

Delete all images.

docker rmi $(docker images -q)

Remove all unused dangling images.

docker rmi $(docker images --filter "dangling=true" -q --no-trunc)

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