Kaptain.
Telegram /
LinkedIn /
Email /
GIT /
RSS /
GPG /
Заказ печатных плат

№ 10098 В разделе
Sysadmin
от June 25th, 2019,
В подшивках: Docker
To remove old images (in my case images can’t be older 14 days) I used https://github.com/andrey-pohilko/registry-cli and included registry tools to collect garbage.
Make sure you run your registry with REGISTRY_STORAGE_DELETE_ENABLED=true
docker run -d -p 127.0.0.1:5000:5000 -e "REGISTRY_STORAGE_DELETE_ENABLED=true" --restart always \ --name docker-images-registry \ -v /srv/registry/data:/var/lib/registry \ -v /srv/registry/users:/auth/htpasswd registry:2
Now you can delete images
docker run --rm --link docker-images-registry anoxis/registry-cli \ -r http://docker-images-registry:5000 --delete --keep-by-hours 336 \ --keep-tags-like latest --digest-method=GET
Ok, use garbage collector
docker stop docker-images-registry docker run --rm -v /srv/registry/data:/var/lib/registry \ -v /srv/registry/users:/auth/htpasswd registry:2 \ bin/registry garbage-collect /etc/docker/registry/config.yml docker start docker-images-registry
Well done! Take a donut from a shelf.
Fortune cookie: TAPPING? You POLITICIANS! Don't you realize that the END of the "Wash Cycle" is a TREASURED MOMENT for most people?!
Leave a Reply