From cd9a5694cf313521e7414991b83a62b2c1254ec1 Mon Sep 17 00:00:00 2001 From: Kristian Haugene Date: Wed, 4 Nov 2020 00:59:33 +0100 Subject: [PATCH] Print revision to logs on startup to make debugging easier --- Dockerfile | 7 +++++++ openvpn/start.sh | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/Dockerfile b/Dockerfile index 01b6dae1a..b7c9af951 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,6 +55,13 @@ ENV OPENVPN_USERNAME=**None** \ HEALTHCHECK --interval=1m CMD /etc/scripts/healthcheck.sh +# Add labels to identify this image and version +ARG REVISION +# Set env from build argument or default to empty string +ENV REVISION=${REVISION:-""} +LABEL org.opencontainers.image.source=https://github.com/haugene/docker-transmission-openvpn +LABEL org.opencontainers.image.revision=$REVISION + # Expose port and run EXPOSE 9091 CMD ["dumb-init", "/etc/openvpn/start.sh"] diff --git a/openvpn/start.sh b/openvpn/start.sh index 4bf31b028..4f6d44dcc 100755 --- a/openvpn/start.sh +++ b/openvpn/start.sh @@ -4,6 +4,10 @@ # Get some initial setup out of the way. ## +if [[ -n "$REVISION" ]]; then + echo "Starting container with revision: $REVISION" +fi + [[ "${DEBUG}" == "true" ]] && set -x # If openvpn-pre-start.sh exists, run it