Docker Registry Cleanup Cron runs as a docker container on the same machine as your v2 registry
- Only version v2 of the registry is supported
- Only docker version with the garbage-collect API supported
CLEANISTRY_DOCKER_HOST_URL
- Mandatory environment variable which helps set the private registry to be cleaned's URL e.g. dockerhub.company.com:5000CLEANISTRY_CATALOG_LIMIT
- Catalog limit to be used while getting a the list of all images. Default is 50000CLEANISTRY_KEEP_LATEST_TAG
- Should we ignore all images with the latest tag?CLEANISTRY_IMAGE_TAG_EXCEMPTION
- true/false. Default is true just to save unwanted cleanupsCLEANISTRY_IMAGE_TAG_EXCEMPTION_LIST_API
- API to fetch the image tag excemption listCLEANISTRY_IMAGE_TAG_EXCEMPTION_LIST
- List of excepmted tags of imagesCLEANISTRY_MAX_IMAGE_LIFETIME
- Default lifetime is 720 hoursCLEANISTRY_RUN_SCHEDULE
- Default schedule is@daily
CLEANISTRY_RUN_ON_START
- Should the cleanup be run once before doing it in scheduleCLEANISTRY_GARBAGE_COLLECT_COMMAND
- Default command isdocker exec registry registry garbage-collect /etc/docker/registry/config.yml
docker run -d \
-e CLEANISTRY_DOCKER_HOST_URL="dockerhub.company.com:5000" \
-e CLEANISTRY_CATALOG_LIMIT=5000 \
-e CLEANISTRY_IMAGE_TAG_EXCEMPTION=true \
-e CLEANISTRY_IMAGE_TAG_EXCEMPTION_LIST_API=releasecandidates.company.com/yourapiToFetchRCs \
-v /var/run/docker.sock:/var/run/docker.sock \
sreeharimohan/cleanistry