From 142ca55074c90164ca182d73e95d9195ebb84c02 Mon Sep 17 00:00:00 2001 From: Martin Reinhardt Date: Fri, 15 Dec 2023 18:10:14 +0100 Subject: [PATCH] Use OCI Label defaults on Docker images (#145) Co-authored-by: Knut Ahlers --- .git_changerelease.yaml | 3 +++ Dockerfile | 7 ++++++- Dockerfile.minimal | 7 ++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.git_changerelease.yaml b/.git_changerelease.yaml index dae7409..6ec9da7 100644 --- a/.git_changerelease.yaml +++ b/.git_changerelease.yaml @@ -21,5 +21,8 @@ pre_commit_commands: - |- yq -iP ".services.app.build.context = \"https://github.com/Luzifer/ots.git#v${TAG_VERSION}\"" docker-compose.yml git add docker-compose.yml + - |- + sed -i -E "s@org.opencontainers.image.version='[^']*'@org.opencontainers.image.version='${TAG_VERSION}'@" Dockerfile Dockerfile.minimal + git add Dockerfile Dockerfile.minimal ... diff --git a/Dockerfile b/Dockerfile index d9e3f64..ab9a0c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,7 +25,12 @@ RUN set -ex \ FROM alpine:latest -LABEL maintainer "Knut Ahlers " +LABEL org.opencontainers.image.authors='Knut Ahlers ' \ + org.opencontainers.image.version='v1.11.1' \ + org.opencontainers.image.url='https://hub.docker.com/r/luzifer/ots/' \ + org.opencontainers.image.documentation='https://github.com/Luzifer/ots/wiki' \ + org.opencontainers.image.source='https://github.com/Luzifer/ots' \ + org.opencontainers.image.licenses='Apache-2.0' RUN set -ex \ && apk --no-cache add \ diff --git a/Dockerfile.minimal b/Dockerfile.minimal index e4206a4..9e7531d 100644 --- a/Dockerfile.minimal +++ b/Dockerfile.minimal @@ -25,7 +25,12 @@ RUN set -ex \ FROM scratch -LABEL maintainer "Knut Ahlers " +LABEL org.opencontainers.image.authors='Knut Ahlers ' \ + org.opencontainers.image.version='v1.11.1' \ + org.opencontainers.image.url='https://hub.docker.com/r/luzifer/ots/' \ + org.opencontainers.image.documentation='https://github.com/Luzifer/ots/wiki' \ + org.opencontainers.image.source='https://github.com/Luzifer/ots' \ + org.opencontainers.image.licenses='Apache-2.0' COPY --from=builder /go/bin/ots /usr/local/bin/ots