From c451250faab2430f837c13f3a6ac20068ea6eace Mon Sep 17 00:00:00 2001 From: Salah Al Saleh Date: Mon, 5 Feb 2024 17:28:33 -0800 Subject: [PATCH] Update dev env garbage collection (#134) * update dev env image garbage collection --- kustomize/overlays/dev/registry.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/kustomize/overlays/dev/registry.yaml b/kustomize/overlays/dev/registry.yaml index edcf887..01ad52c 100644 --- a/kustomize/overlays/dev/registry.yaml +++ b/kustomize/overlays/dev/registry.yaml @@ -63,17 +63,19 @@ data: entrypoint.sh: | #!/bin/sh set -e - echo "0 * * * * /garbage-collect.sh >> /proc/1/fd/1 2>&1" > /etc/crontabs/root - crond + /garbage-collect.sh & registry serve /etc/docker/registry/config.yml garbage-collect.sh: | #!/bin/sh - set -e - if [ ! -d "/var/lib/registry/docker" ]; then - echo "No registry data found, skipping garbage collection" - exit 0 - fi - registry garbage-collect /etc/docker/registry/config.yml + while true; do + sleep 1m + if [ ! -d "/var/lib/registry/docker" ]; then + echo "No registry data found, skipping garbage collection" + else + echo "Starting garbage collection..." + registry garbage-collect /etc/docker/registry/config.yml || true + fi + done --- apiVersion: v1 kind: ConfigMap