From 73481de608dd49542bac873922e5b8eb4515931b Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Sun, 1 Sep 2024 16:41:04 -0700 Subject: [PATCH] Add docker labels to have update tools be able to pull changelog/release notes For example https://docs.renovatebot.com/modules/datasource/docker/ but other tools will pull those same labels --- docker/build/x86_64/Dockerfile | 2 ++ docker/build/x86_64/Dockerfile-CUDA | 2 ++ docker/ci/x86_64/Dockerfile | 2 ++ docker/ci/x86_64/docker_push.sh | 7 ++++++- 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docker/build/x86_64/Dockerfile b/docker/build/x86_64/Dockerfile index b945c9c4adc..d1b7cb6c021 100644 --- a/docker/build/x86_64/Dockerfile +++ b/docker/build/x86_64/Dockerfile @@ -32,6 +32,8 @@ RUN make flags-release flags-pie stash # Final Runnable Image FROM alpine:latest +ARG STASH_VERSION +LABEL org.opencontainers.image.source="https://github.com/stashapp/stash/" org.opencontainers.image.revision=${STASH_VERSION} RUN apk add --no-cache ca-certificates vips-tools ffmpeg COPY --from=backend /stash/stash /usr/bin/ ENV STASH_CONFIG_FILE=/root/.stash/config.yml diff --git a/docker/build/x86_64/Dockerfile-CUDA b/docker/build/x86_64/Dockerfile-CUDA index f76c6dea609..445c48e22e4 100644 --- a/docker/build/x86_64/Dockerfile-CUDA +++ b/docker/build/x86_64/Dockerfile-CUDA @@ -32,6 +32,8 @@ RUN make flags-release flags-pie stash # Final Runnable Image FROM nvidia/cuda:12.0.1-base-ubuntu22.04 +ARG STASH_VERSION +LABEL org.opencontainers.image.source="https://github.com/stashapp/stash/" org.opencontainers.image.revision=${STASH_VERSION} RUN apt update && apt upgrade -y && apt install -y ca-certificates libvips-tools ffmpeg wget intel-media-va-driver-non-free vainfo RUN rm -rf /var/lib/apt/lists/* COPY --from=backend /stash/stash /usr/bin/ diff --git a/docker/ci/x86_64/Dockerfile b/docker/ci/x86_64/Dockerfile index 96610b7d219..482ccb87a99 100644 --- a/docker/ci/x86_64/Dockerfile +++ b/docker/ci/x86_64/Dockerfile @@ -10,6 +10,8 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm/v6" ]; then BIN=stash-linux-arm32v6; \ mv $BIN /stash FROM --platform=$TARGETPLATFORM alpine:latest AS app +ARG STASH_VERSION +LABEL org.opencontainers.image.source="https://github.com/stashapp/stash/" org.opencontainers.image.revision=${STASH_VERSION} COPY --from=binary /stash /usr/bin/ # vips version 8.15.0-r0 breaks thumbnail generation on arm32v6 diff --git a/docker/ci/x86_64/docker_push.sh b/docker/ci/x86_64/docker_push.sh index 7ca5ff201f8..08dc3e4509a 100644 --- a/docker/ci/x86_64/docker_push.sh +++ b/docker/ci/x86_64/docker_push.sh @@ -10,5 +10,10 @@ done echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin # must build the image from dist directory -docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 --push $DOCKER_TAGS -f docker/ci/x86_64/Dockerfile dist/ +docker buildx build \ + --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 \ + --build-arg "STASH_VERSION=${TAG}" \ + --push "${DOCKER_TAGS}" \ + --file docker/ci/x86_64/Dockerfile \ + dist/