garethr-docker icon indicating copy to clipboard operation
garethr-docker copied to clipboard

Remove untagged images

Open skoch123 opened this issue 8 years ago • 4 comments
trafficstars

Hello! How to remove untagged images from docker?

skoch123 avatar Feb 14 '17 04:02 skoch123

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}")

scotty-c avatar Feb 14 '17 21:02 scotty-c

If you're using the latest version of docker you can just do:

docker image prune

dbason avatar May 02 '17 02:05 dbason

You can set this to run on a cron: https://github.com/spotify/docker-gc

Not exactly the same but gets the job done

jcrsilva avatar May 24 '17 11:05 jcrsilva

This PR will help to keep only a single tag of a given image: https://github.com/garethr/garethr-docker/pull/696

gdubicki avatar Jun 13 '17 13:06 gdubicki