Skip to content

Instantly share code, notes, and snippets.

@makomweb
Last active October 10, 2023 15:31
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 makomweb/c6035bdcec2bb66058f77811324418d8 to your computer and use it in GitHub Desktop.
Save makomweb/c6035bdcec2bb66058f77811324418d8 to your computer and use it in GitHub Desktop.
Remove docker images / containers
# Remove Image
docker rmi <imageId/Name>
# Force remove image
docker rmi -f <imageId/Name>
# Remove dangling images
docker image prune
# Remove all images
docker rmi $(docker images -q)
# Stop container
docker stop <containerId/Name>
# Stop all running containers
docker stop $(docker ps -aq)
# Delete the container
docker rm <containerId/Name>
# Force delete a container
docker rm -f <containerId/Name>
# Remove all conatiners
docker rm $(docker ps -aq)
# Remove all stopped containers
docker rm $(docker ps -aq --filter status="exited")
# Remove all exited containers
docker container prune
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment