Update dev env garbage collection (#134)

* update dev env image garbage collection
This commit is contained in:
Salah Al Saleh
2024-02-05 17:28:33 -08:00
committed by GitHub
parent a55a60a2f5
commit c451250faa

View File

@@ -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