entrypoint.sh 685 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. set -e
  3. CONFIG_YML=/etc/docker/registry/config.yml
  4. if [ -n "$PROXY_REMOTE_URL" -a `grep -c "$PROXY_REMOTE_URL" $CONFIG_YML` -eq 0 ]; then
  5. echo "proxy:" >> $CONFIG_YML
  6. echo " remoteurl: $PROXY_REMOTE_URL" >> $CONFIG_YML
  7. echo "------ Enabled proxy to remote: $PROXY_REMOTE_URL ------"
  8. elif [ $DELETE_ENABLED = true -a `grep -c "delete:" $CONFIG_YML` -eq 0 ]; then
  9. sed -i '/rootdirectory/a\ delete:' $CONFIG_YML
  10. sed -i '/delete/a\ enabled: true' $CONFIG_YML
  11. echo "------ Enabled local storage delete -----"
  12. fi
  13. case "$1" in
  14. *.yaml|*.yml) set -- registry serve "$@" ;;
  15. serve|garbage-collect|help|-*) set -- registry "$@" ;;
  16. esac
  17. exec "$@"