Print revision to logs on startup to make debugging easier

This commit is contained in:
Kristian Haugene
2020-11-04 00:59:33 +01:00
parent f27d47c121
commit cd9a5694cf
2 changed files with 11 additions and 0 deletions

View File

@@ -55,6 +55,13 @@ ENV OPENVPN_USERNAME=**None** \
HEALTHCHECK --interval=1m CMD /etc/scripts/healthcheck.sh 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 port and run
EXPOSE 9091 EXPOSE 9091
CMD ["dumb-init", "/etc/openvpn/start.sh"] CMD ["dumb-init", "/etc/openvpn/start.sh"]

View File

@@ -4,6 +4,10 @@
# Get some initial setup out of the way. # Get some initial setup out of the way.
## ##
if [[ -n "$REVISION" ]]; then
echo "Starting container with revision: $REVISION"
fi
[[ "${DEBUG}" == "true" ]] && set -x [[ "${DEBUG}" == "true" ]] && set -x
# If openvpn-pre-start.sh exists, run it # If openvpn-pre-start.sh exists, run it