Last active
May 4, 2022 05:23
-
-
Save kkbruce/b575a5c58120fdff4ff676b857a78e24 to your computer and use it in GitHub Desktop.
This file contains 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
# step 1, clean dangling image | |
docker rmi $(docker images -f "dangling=true" -q) | |
# step 2, search "before | since" images | |
## see "CREATED" | |
docker images --filter "since=baseimage" | |
# step 3, get IMAGE ID | |
docker images --filter "since=baseimage" -q | |
# step 3-1, Range | |
docker images --filter "since=baseimage" --filter "before=baseimage" | |
# step 4, delete "before | since" images | |
## if images have running container, can't delete it. don't worry. | |
docker rmi $(docker images --filter "since=baseimage" -q) | |
#################################################################### | |
# quickly delete by baseimage | |
docker images baseimage | |
docker rmi $(docker images baseimage -q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment