docker icon indicating copy to clipboard operation
docker copied to clipboard

Possibility to remove unused docker images

Open spotlesscoder opened this issue 7 years ago • 4 comments

I want to be able to remove unused docker images in a similar way like I can do in portainer.io's UI:

image

Is there a recipe for this which should automatically find unused images and delete all of them in a configurable interval

spotlesscoder avatar Jan 12 '18 15:01 spotlesscoder

Spotify has a garbage collection container that clean up old images. I run this on a cron schedule on all my docker instances. I can dig up the url for it later, if you can’t find it.

On Fri, Jan 12, 2018 at 07:05 CodingSpiderFox [email protected] wrote:

I want to be able to remove unused docker images in a similar way like I can do in portainer.io's UI:

[image: image] https://user-images.githubusercontent.com/25173078/34880918-3fc5189a-f7b2-11e7-84cd-1f8cc49266d7.png

Is there a recipe for this which should automatically find unused images and delete all of them in a configurable interval

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/chef-cookbooks/docker/issues/956, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKpSIjHLFD6NYV1cHs2v84KDxn9bzmWks5tJ3S8gaJpZM4Rcadh .

chasebolt avatar Jan 12 '18 15:01 chasebolt

There's an API call in docker-api for this that we should probably look at.

tas50 avatar Jan 14 '18 18:01 tas50

https://docs.docker.com/engine/api/v1.35/#operation/ImagePrune

tas50 avatar Jan 14 '18 18:01 tas50

Unfortunately I don't have the time at the moment to look into it. Hopefully this will change in a few weeks

spotlesscoder avatar Feb 08 '18 22:02 spotlesscoder