From 2f78e74e7f2d8331ac4347bec0ac38ef66d976df Mon Sep 17 00:00:00 2001 From: Walter Doekes Date: Fri, 11 Nov 2022 10:47:01 +0100 Subject: [PATCH] Add versioning to Docker, so we can trace back every component --- Dockerfile | 4 +++- README.rst | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7a44aea..475215b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,8 +6,10 @@ LABEL dockerfile-vcs="https://github.com/ossobv/alert-group-nl-log2slack" ENV PYTHONUNBUFFERED=1 RUN pip install BeautifulSoup4 requests phpserialize COPY alert_group_nl_log2slack.py /srv/ +ARG GITVERSION +RUN echo "$GITVERSION (built $(date +%Y-%m-%d))" >/srv/version CMD python3 -V && pip freeze && echo '.' && \ - echo 'Starting publish-forever...' && \ + echo 'Starting publish-forever...' $(cat /srv/version) && \ ln -sf /usr/share/zoneinfo/${TIMEZONE:-Etc/UTC} /etc/localtime && \ test -s /etc/localtime && \ exec python3 /srv/alert_group_nl_log2slack.py publish diff --git a/README.rst b/README.rst index a64af43..4ae71c5 100644 --- a/README.rst +++ b/README.rst @@ -10,3 +10,8 @@ Requirements:: KLANT_CODE = SLACK_WEBHOOK_URL = https://hooks.slack.com/services/T../B../a.. TIMEZONE = Europe/Amsterdam # used by Docker image + +Building:: + + docker build --build-arg=GITVERSION=$(git describe --always) \ + -t $NAMESPACE/alert-group-nl-log2slack .