Skip to content

Commit

Permalink
r image garbage collection in the background (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored Feb 6, 2024
1 parent 47c0c2c commit a55a60a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions registry/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 "$@" ;;
Expand Down
8 changes: 5 additions & 3 deletions registry/garbage-collect.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a55a60a

Please sign in to comment.