diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index b17ca664..57c7e8ca 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -133,6 +133,7 @@ jobs: docker buildx build \ --platform linux/amd64 \ --provenance=false --sbom=false \ + --build-arg INBUXA_VERSION="$VERSION" \ --build-arg INBUXA_REVISION="${{ github.sha }}" \ --tag "$IMAGE:$VERSION-amd64" \ --tag "$IMAGE:$VERSION" \ @@ -175,6 +176,7 @@ jobs: docker buildx build \ --platform linux/arm64 \ --provenance=false --sbom=false \ + --build-arg INBUXA_VERSION="$VERSION" \ --build-arg INBUXA_REVISION="${{ github.sha }}" \ --tag "$IMAGE:$VERSION-arm64" \ --push . @@ -219,6 +221,8 @@ jobs: docker buildx build -f Dockerfile.relay \ --platform "linux/$arch" \ --provenance=false --sbom=false \ + --build-arg INBUXA_VERSION="$VERSION" \ + --build-arg INBUXA_REVISION="${{ github.sha }}" \ --tag "$RELAY_IMAGE:$VERSION-$arch" \ --push . done diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d94f2cad..c5003231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -297,7 +297,9 @@ jobs: platforms: linux/${{ matrix.arch }} provenance: false sbom: false - build-args: INBUXA_REVISION=${{ github.sha }} + build-args: | + INBUXA_VERSION=${{ env.VERSION }} + INBUXA_REVISION=${{ github.sha }} push: true tags: | ${{ env.IMAGE }}:${{ env.VERSION }}-${{ matrix.arch }} @@ -371,6 +373,9 @@ jobs: platforms: linux/${{ matrix.arch }} provenance: false sbom: false + build-args: | + INBUXA_VERSION=${{ env.VERSION }} + INBUXA_REVISION=${{ github.sha }} push: true tags: ${{ env.RELAY_IMAGE }}:${{ env.VERSION }}-${{ matrix.arch }} diff --git a/Dockerfile b/Dockerfile index e83c1002..7bd58a37 100644 --- a/Dockerfile +++ b/Dockerfile @@ -91,3 +91,18 @@ HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \ CMD curl -fsSk -H "X-Forwarded-For: 127.0.0.1" "$INBUXA_HEALTHCHECK_URL" || curl -fsS -H "X-Forwarded-For: 127.0.0.1" http://127.0.0.1:8080/healthz/live || exit 1 ENTRYPOINT ["/usr/local/bin/inbuxa"] CMD ["--config", "/etc/inbuxa/config.json"] + +# Last in the image, after everything that does work: a value that changes +# every build (the version, the commit) then never costs a cached layer. +# What the image says it is, for registries and anyone inspecting it. +ARG INBUXA_VERSION=dev +ARG INBUXA_REVISION="" +LABEL org.opencontainers.image.title="inbuxa server" \ + org.opencontainers.image.description="The inbuxa mail server: JMAP, IMAP, SMTP and DAV, the store, the filters and the administration API, in one Rust binary." \ + org.opencontainers.image.url="https://inbuxa.org/" \ + org.opencontainers.image.documentation="https://docs.inbuxa.org/" \ + org.opencontainers.image.source="https://git.coffeylabs.org/inbuxa/inbuxa-server" \ + org.opencontainers.image.licenses="AGPL-3.0-only" \ + org.opencontainers.image.vendor="Coffey Labs LLC" \ + org.opencontainers.image.version="$INBUXA_VERSION" \ + org.opencontainers.image.revision="$INBUXA_REVISION" diff --git a/Dockerfile.relay b/Dockerfile.relay index ce43ea03..71bd1177 100644 --- a/Dockerfile.relay +++ b/Dockerfile.relay @@ -43,3 +43,18 @@ ENV INBUXA_RELAY_CONTAINER=1 EXPOSE 25 443 ENTRYPOINT ["/usr/local/bin/inbuxa-relay"] CMD ["run", "--state", "/var/lib/inbuxa-relay"] + +# Last in the image, after everything that does work: a value that changes +# every build (the version, the commit) then never costs a cached layer. +# What the image says it is, for registries and anyone inspecting it. +ARG INBUXA_VERSION=dev +ARG INBUXA_REVISION="" +LABEL org.opencontainers.image.title="inbuxa Relay" \ + org.opencontainers.image.description="A small relay on a public machine that takes mail in for an inbuxa server and sends its mail on, so the server never opens a mail port to the internet." \ + org.opencontainers.image.url="https://inbuxa.org/" \ + org.opencontainers.image.documentation="https://docs.inbuxa.org/run/relay/" \ + org.opencontainers.image.source="https://git.coffeylabs.org/inbuxa/inbuxa-server" \ + org.opencontainers.image.licenses="AGPL-3.0-only" \ + org.opencontainers.image.vendor="Coffey Labs LLC" \ + org.opencontainers.image.version="$INBUXA_VERSION" \ + org.opencontainers.image.revision="$INBUXA_REVISION"