diff --git a/registry/entrypoint.sh b/registry/entrypoint.sh index 7a66e64..2261b18 100755 --- a/registry/entrypoint.sh +++ b/registry/entrypoint.sh @@ -16,9 +16,7 @@ else fi # Run garbage collection job in background -echo "* * * * * /garbage-collect.sh >> /proc/1/fd/1 2>&1" > /etc/crontabs/dyno -chmod 0644 /etc/crontabs/dyno -crond -l 2 +/garbage-collect.sh & case "$1" in *.yaml|*.yml) set -- registry serve "$@" ;; diff --git a/registry/garbage-collect.sh b/registry/garbage-collect.sh index 2b102ac..93c424a 100755 --- a/registry/garbage-collect.sh +++ b/registry/garbage-collect.sh @@ -1,5 +1,7 @@ #!/bin/sh -echo "Starting garbage collection..." - -registry garbage-collect /etc/docker/registry/config.yml +while true; do + sleep 1m + echo "Starting garbage collection..." + registry garbage-collect /etc/docker/registry/config.yml || true +done