Last active
October 10, 2023 15:31
-
-
Save makomweb/c6035bdcec2bb66058f77811324418d8 to your computer and use it in GitHub Desktop.
Remove docker images / containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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