Set org.opencontainers.image.version label on release images

The published Docker images are missing the org.opencontainers.image.version
label, so image updaters cannot tell which ntfy version they are running
(#1921).

PR #1307 added the LABEL to Dockerfile-build, but that file is not
referenced by the goreleaser docker builds: the release pipeline builds
amd64 images from Dockerfile and the arm images from Dockerfile-arm,
neither of which had the label, and no build arg was passed to either.

Add an ARG VERSION=dev and the LABEL to both release Dockerfiles, and pass
--build-arg=VERSION={{ .Version }} in the goreleaser build flags so the
real version from the release tag lands in the image config.
This commit is contained in:
echo committed 2026-09-06 18:00:27 +08:00
1 parent 10cb6506f8
commit 1afeeee50a
3 files changed
+10

No files matched your search

+4
View File
@@ -156,6 +156,7 @@ dockers:
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
- "--build-arg=VERSION={{ .Version }}"
- image_templates:
- &arm64v8_image "binwiederhier/ntfy:{{ .Tag }}-arm64v8"
use: buildx
@@ -163,6 +164,7 @@ dockers:
goarch: arm64
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--build-arg=VERSION={{ .Version }}"
- image_templates:
- &armv7_image "binwiederhier/ntfy:{{ .Tag }}-armv7"
use: buildx
@@ -171,6 +173,7 @@ dockers:
goarm: 7
build_flag_templates:
- "--platform=linux/arm/v7"
- "--build-arg=VERSION={{ .Version }}"
- image_templates:
- &armv6_image "binwiederhier/ntfy:{{ .Tag }}-armv6"
use: buildx
@@ -179,6 +182,7 @@ dockers:
goarm: 6
build_flag_templates:
- "--platform=linux/arm/v6"
- "--build-arg=VERSION={{ .Version }}"
docker_manifests:
- name_template: "binwiederhier/ntfy:latest"
image_templates:
+3
View File
@@ -1,5 +1,7 @@
FROM alpine
ARG VERSION=dev
LABEL org.opencontainers.image.authors="philipp.heckel@gmail.com"
LABEL org.opencontainers.image.url="https://ntfy.sh/"
LABEL org.opencontainers.image.documentation="https://docs.ntfy.sh/"
@@ -8,6 +10,7 @@ LABEL org.opencontainers.image.vendor="Philipp C. Heckel"
LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
LABEL org.opencontainers.image.title="ntfy"
LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"
LABEL org.opencontainers.image.version="$VERSION"
RUN apk add --no-cache tzdata
COPY ntfy /usr/bin
+3
View File
@@ -1,5 +1,7 @@
FROM alpine
ARG VERSION=dev
LABEL org.opencontainers.image.authors="philipp.heckel@gmail.com"
LABEL org.opencontainers.image.url="https://ntfy.sh/"
LABEL org.opencontainers.image.documentation="https://docs.ntfy.sh/"
@@ -8,6 +10,7 @@ LABEL org.opencontainers.image.vendor="Philipp C. Heckel"
LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
LABEL org.opencontainers.image.title="ntfy"
LABEL org.opencontainers.image.description="Send push notifications to your phone or desktop using PUT/POST"
LABEL org.opencontainers.image.version="$VERSION"
# Alpine does not support adding "tzdata" on ARM anymore, see
# https://github.com/binwiederhier/ntfy/issues/894