Files
ttl.sh/registry/entrypoint.sh
2019-05-16 00:14:47 +00:00

24 lines
679 B
Bash
Executable File

#!/bin/sh
set -e
sed -i "s/__PORT__/$PORT/g" /etc/docker/registry/config.yml
sed -i "s/__HOOK_TOKEN__/$HOOK_TOKEN/g" /etc/docker/registry/config.yml
sed -i "s/__HOOK_URI__/$HOOK_URI/g" /etc/docker/registry/config.yml
sed -i "s/__REPLREG_HOST__/$REPLREG_HOST/g" /etc/docker/registry/config.yml
sed -i "s/__REPLREG_SECRET__/$REPLREG_SECRET/g" /etc/docker/registry/config.yml
if [[ -z "${GCS_KEY_ENCODED}" ]]; then
echo "Set GCS_KEY_ENCODED variable"
else
echo ${GCS_KEY_ENCODED} | base64 -d > /etc/gcs.json
chmod 0400 /etc/gcs.json
fi
case "$1" in
*.yaml|*.yml) set -- registry serve "$@" ;;
serve|garbage-collect|help|-*) set -- registry "$@" ;;
esac
exec "$@"