Distribution: Config for registry garbage collection should already be inside the registry container

Created on 19 May 2017  路  3Comments  路  Source: distribution/distribution

From https://docs.docker.com/registry/garbage-collection/#how-garbage-collection-works, the way to run a garbage collection is to execute this within the container:

bin/registry garbage-collect [--dry-run] /path/to/config.yml

Where the config.yml has to be of the form:

version: 0.1
storage:
  filesystem:
    rootdirectory: /registry/data

However, when shipped as a docker container, this root directory is well defined (/var/lib/registry). Is it possible then to add this configuration to the base container so that I dont have to mount this config in or rebuild the container and add the config myself.

In the end, my goal is to be able to just pull the docker registry and create a cron job that will run:
docker exec registry bin/registry garbage-collect /gcconfig/config.yml

Most helpful comment

The config inside the registry container is located at /etc/docker/registry/config.yml.

All 3 comments

The config inside the registry container is located at /etc/docker/registry/config.yml.

my bad. Discovered this after some more digging around.

This should be the default example in the docs...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhaochenglan picture zhaochenglan  路  3Comments

Duoxilian picture Duoxilian  路  3Comments

tgross picture tgross  路  3Comments

ghost picture ghost  路  5Comments

blackfader picture blackfader  路  4Comments