mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-18 16:25:16 +01:00
d5b85a6748
docker regsitry. This version has the API to call regsitry GC with jobservice secret. Seprates it into a standalone container as do not want to invoke two processes in one container. It needs to mount the registry storage into this container in order to do GC, and needs to copy the registry binary into it.
21 lines
705 B
Bash
21 lines
705 B
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
# The directory /var/lib/registry is within the container, and used to store image in CI testing.
|
|
# So for now we need to chown to it to avoid failure in CI.
|
|
if [ -d /var/lib/registry ]; then
|
|
chown 10000:10000 -R /var/lib/registry
|
|
fi
|
|
|
|
if [ -d /storage ]; then
|
|
if ! stat -c '%u:%g' /storage | grep -q '10000:10000' ; then
|
|
# 10000 is the id of harbor user/group.
|
|
# Usually NFS Server does not allow changing owner of the export directory,
|
|
# so need to skip this step and requires NFS Server admin to set its owner to 10000.
|
|
chown 10000:10000 -R /storage
|
|
fi
|
|
fi
|
|
|
|
sudo -E -u \#10000 "/harbor/harbor_registryctl" "-c" "/etc/registryctl/config.yml"
|