bin/registry-gc

21 lines
477 B
Plaintext
Raw Normal View History

2023-02-25 02:44:30 +01:00
#!/usr/bin/env bash
# registry-gc
# description: run garbage collection on registry
# name: registry
set -eu
if ! sudo podman container exists registry; then
echo "registry container does not exist"
exit 1
fi
if sudo podman container exec -it registry bin/registry garbage-collect /etc/docker/registry/config.yml -m; then
echo "Registry garbage collection ran successfully"
exit 0
else
echo "Error running registry garbage collection"
exit 1
fi