diff --git a/Dockerfile b/Dockerfile index 91a2742..4d3fdc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,13 +7,21 @@ LABEL org.opencontainers.image.url="https://github.com/owncloud-ops/registry" LABEL org.opencontainers.image.source="https://github.com/owncloud-ops/registry" LABEL org.opencontainers.image.documentation="https://github.com/owncloud-ops/registry" +ARG CONTAINER_LIBRARY_VERSION + +# renovate: datasource=github-releases depName=owncloud-ops/container-library +ENV CONTAINER_LIBRARY_VERSION="${CONTAINER_LIBRARY_VERSION:-v0.1.0}" + ADD overlay/ / ADD src/bin/registry /bin/registry RUN addgroup -g 1001 -S app && \ adduser -S -D -H -u 1001 -h /home/app -s /bin/sh -G app -g app app -RUN apk add --no-cache ca-certificates && \ +RUN apk --update add --virtual .build-deps curl tar && \ + apk add --no-cache ca-certificates && \ + curl -SsL "https://github.com/owncloud-ops/container-library/releases/download/${CONTAINER_LIBRARY_VERSION}/container-library.tar.gz" | tar xz -C / && \ + apk del .build-deps && \ rm -rf /var/cache/apk/* && \ rm -rf /tmp/* diff --git a/overlay/usr/bin/entrypoint b/overlay/usr/bin/entrypoint index db3a567..0bfa5b9 100755 --- a/overlay/usr/bin/entrypoint +++ b/overlay/usr/bin/entrypoint @@ -1,7 +1,9 @@ #!/usr/bin/env sh +# shellcheck disable=SC3040 set -eo pipefail +# shellcheck disable=SC3046,SC1091 source /usr/local/lib/log.sh log_info "Start Docker Registry\n" diff --git a/overlay/usr/bin/healthcheck b/overlay/usr/bin/healthcheck index 7e25c39..480ad76 100755 --- a/overlay/usr/bin/healthcheck +++ b/overlay/usr/bin/healthcheck @@ -1,5 +1,6 @@ #!/usr/bin/env sh +# shellcheck disable=SC3040 set -eo pipefail URL=http://127.0.0.1:5000 diff --git a/overlay/usr/local/lib/log.sh b/overlay/usr/local/lib/log.sh deleted file mode 100644 index d5c2d8c..0000000 --- a/overlay/usr/local/lib/log.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env sh - -# Log the given message at the given level. All logs are written to stderr with a timestamp. -function log { - level="$1" - message="$2" - timestamp=$(date +"%Y-%m-%d %H:%M:%S") - script_name="$(basename "$0")" - >&2 echo -e "${timestamp} [${level}] [$script_name] ${message}" -} - -# Log the given message at INFO level. All logs are written to stderr with a timestamp. -function log_info { - message="$1" - log "INFO" "$message" -} - -# Log the given message at WARN level. All logs are written to stderr with a timestamp. -function log_warn { - message="$1" - log "WARN" "$message" -} - -# Log the given message at ERROR level. All logs are written to stderr with a timestamp. -function log_error { - message="$1" - log "ERROR" "$message" -} \ No newline at end of file