r image garbage collection in the background (#133)

This commit is contained in:
Salah Al Saleh
2024-02-05 17:01:19 -08:00
committed by GitHub
parent 47c0c2c72c
commit a55a60a2f5
2 changed files with 6 additions and 6 deletions

View File

@@ -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 "$@" ;;

View File

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