when I run a command such as sudo docker rmi me/myimage I get the responce ...image untagged, but, when I rerun sudo docker images I can see that this "untagged" image is still there, and, if I run df -h I can see that the actual files still exist and occupy the file system space. What command or procedure can I use to physically remove the unneeded images?
相关问题
- Docker task in Azure devops won't accept "$(pw
- Unable to run mariadb when mount volume
- Unspecified error (0x80004005) while running a Doc
- What would prevent code running in a Docker contai
- How to reload apache in php-apache docker containe
you can delete single images by their image id...
First you need to remove exited containers, then remove dangling images.
After all, I created the below script as ~/bin/dclean and have been using it.
If John Petrone solution doesn't work, try removing those images referring explicitly the
IMAGE ID
you see when you rundocker images
. You can remove all of them with one commandfor i in
sudo docker images | grep \ | awk '{print $3}'; do sudo docker rmi $i; done
PD: I don't know John Petrone answer. It works nicely with Docker 1.4.1
You should be able to remove untagged Docker images using the
"dangling=true"
flag:source:
https://docs.docker.com/engine/reference/commandline/images/
This command will remove all the dangling images and containers from docker.
This commands also work
Delete images with force to forgo stopped containers that might be using image