Skip to content

Commit

Permalink
Update dev env garbage collection (#134)
Browse files Browse the repository at this point in the history
* update dev env image garbage collection
  • Loading branch information
sgalsaleh authored Feb 6, 2024
1 parent a55a60a commit c451250
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions kustomize/overlays/dev/registry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c451250

Please sign in to comment.