garethr-docker
garethr-docker copied to clipboard
Remove untagged images
trafficstars
Hello! How to remove untagged images from docker?
I don't believe the module supports removing untagged images, but you can run the following docker rmi $(docker images | grep "^<none>" | awk "{print $3}")
If you're using the latest version of docker you can just do:
docker image prune
You can set this to run on a cron: https://github.com/spotify/docker-gc
Not exactly the same but gets the job done
This PR will help to keep only a single tag of a given image: https://github.com/garethr/garethr-docker/pull/696