From f0bcd505032c8a0eb1f5d350cac1b3656221072f Mon Sep 17 00:00:00 2001 From: Molham Al Nasr Date: Wed, 8 Jan 2025 12:14:07 +0100 Subject: [PATCH] Fixes #858: add conventional labels to the docker image and pass the github.ref_name as VERSION_TAG build_args in docker/build-push-action pipeline --- .github/workflows/dockerhub.yml | 2 ++ Dockerfile | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/dockerhub.yml b/.github/workflows/dockerhub.yml index 38a5b8c..4b67502 100644 --- a/.github/workflows/dockerhub.yml +++ b/.github/workflows/dockerhub.yml @@ -44,3 +44,5 @@ jobs: ghcr.io/${{ github.repository }}:latest ghcr.io/${{ github.repository }}:${{ github.ref_name }} platforms: linux/amd64,linux/arm/v7,linux/arm/v6,linux/arm64 + build-args: | + VERSION_TAG=${{ github.ref_name }} diff --git a/Dockerfile b/Dockerfile index 644a75a..aec97b4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,6 +17,17 @@ RUN pnpm build # production stage FROM alpine:3.21 +LABEL \ + org.label-schema.schema-version="1.0" \ + org.label-schema.version="$VERSION_TAG" \ + org.opencontainers.image.title="Homer Image" \ + org.opencontainers.image.description="A dead simple static HOMepage for your servER to keep your services on hand, from a simple yaml configuration file." \ + org.opencontainers.image.ref.name="b4bz/homer:22-alpine3.20" \ + org.opencontainers.image.version="$VERSION_TAG" \ + org.opencontainers.image.licenses="Apache-2.0 license" \ + org.opencontainers.image.source="https://github.com/bastienwirtz/homer" \ + org.opencontainers.image.url="https://homer-demo.netlify.app/" + ENV GID=1000 \ UID=1000 \ PORT=8080 \