#!/bin/sh

set -e

/usr/bin/harbor-install-cert.sh
chown -R registry:registry /var/lib/docker-registry
# The /var/lib/docker-registry volume is shared between the harbor-registry and the
# harbor-registryctl containers, which run with different users. Relaxing the umask
# allows other users in the registry group to modify files in the shared volume.
chmod -R g+w /var/lib/docker-registry
umask 0002
exec /usr/bin/gosu registry:registry /usr/bin/registry "$@"

