diff options
Diffstat (limited to 'community/docker-registry/docker-registry.initd')
-rw-r--r-- | community/docker-registry/docker-registry.initd | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/community/docker-registry/docker-registry.initd b/community/docker-registry/docker-registry.initd index a800f2e9ccb..f8bcd9ffd48 100644 --- a/community/docker-registry/docker-registry.initd +++ b/community/docker-registry/docker-registry.initd @@ -1,27 +1,34 @@ #!/sbin/openrc-run -# These awfully long uppercase variables are here only for backward -# compatibility. Do not use them! -: ${logfile:=${DOCKER_REGISTRY_LOGFILE:-"/var/log/docker-registry.log"}} -: ${conffile:=${DOCKER_REGISTRY_CONFIG:-"/etc/docker-registry/config.yml"}} -: ${user:="docker-registry"} -: ${group:="$user"} - name="Docker Registry" +# $conffile, $user and $group are deprecated since Alpine v3.17. +: ${cfgfile:=${conffile:-"/etc/docker-registry/config.yml"}} +: ${command_user:=${user:-"docker-registry"}:${group:-${user:-"docker-registry"}}} + +: ${healthcheck_url="http://127.0.0.1:5001/debug/health"} +: ${healthcheck_timer=5} + command="/usr/bin/docker-registry" -command_args="serve $conffile" +command_args="serve $cfgfile" command_background="yes" - pidfile="/run/$RC_SVCNAME.pid" -start_stop_daemon_args=" - --user $user:$group - --stdout $logfile - --stderr $logfile" -required_files="$conffile" +required_files="$cfgfile" + +depend() { + need localmount net + use dns +} start_pre() { - checkpath -d -m 0770 -o "$user:$group" /var/lib/registry - checkpath -f -m 0644 -o "$user:$group" "$logfile" + if [ "$logfile" ]; then + error_log="$logfile" + checkpath -f -m 0644 -o "$command_user" "$logfile" || return 1 + fi +} + +healthcheck() { + [ "$healthcheck_url" ] || return 0 + wget -q -O - "$healthcheck_url" >/dev/null 2>&1 } |