Skip to content

Commit

Permalink
Add: switch to opencontainers LABELs for the Dockerfile
Browse files Browse the repository at this point in the history
label-schema is deprecated in favour of OCI. It also specifies
a bit more keys, making it a bit easier for some automated
systems to do their job correctly.

While at it, make Dockerfile over repositories more the same.
  • Loading branch information
TrueBrain committed Sep 17, 2020
1 parent 1be1848 commit ef666d8
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@ FROM python:3.8-slim
ARG BUILD_DATE=""
ARG BUILD_VERSION="dev"

LABEL maintainer="[email protected]"
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.build-date=${BUILD_DATE}
LABEL org.label-schema.version=${BUILD_VERSION}
LABEL maintainer="OpenTTD Dev Team <[email protected]>"
LABEL org.opencontainers.image.created=${BUILD_DATE}
LABEL org.opencontainers.image.authors="OpenTTD Dev Team <[email protected]>"
LABEL org.opencontainers.image.url="https://github.com/OpenTTD/master-server-web"
LABEL org.opencontainers.image.source="https://github.com/OpenTTD/master-server-web"
LABEL org.opencontainers.image.version=${BUILD_VERSION}
LABEL org.opencontainers.image.licenses="GPLv2"
LABEL org.opencontainers.image.title="Web frontend for the Master Server Public Server Listing"
LABEL org.opencontainers.image.description="This is a front-end for the Master Server Public Server listing."

WORKDIR /code

COPY requirements.txt \
LICENSE \
README.md \
.version \
/code/
# Needed for Sentry to know what version we are running
RUN echo "${BUILD_VERSION}" > /code/.version
Expand All @@ -22,9 +26,9 @@ RUN pip --no-cache-dir install -r requirements.txt

# Validate that what was installed was what was expected
RUN pip freeze 2>/dev/null > requirements.installed \
&& diff -u --strip-trailing-cr requirements.txt requirements.installed 1>&2 \
|| ( echo "!! ERROR !! requirements.txt defined different packages or versions for installation" \
&& exit 1 ) 1>&2
&& diff -u --strip-trailing-cr requirements.txt requirements.installed 1>&2 \
|| ( echo "!! ERROR !! requirements.txt defined different packages or versions for installation" \
&& exit 1 ) 1>&2

COPY webclient /code/webclient

Expand Down

0 comments on commit ef666d8

Please sign in to comment.