Dockers v2

This commit is contained in:
binwiederhier 2026-03-07 17:17:25 -05:00
parent fcf95dc9b8
commit 7093ac569e
3 changed files with 34 additions and 82 deletions

View file

@ -54,9 +54,8 @@ builds:
ldflags: ldflags:
- "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}" - "-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}"
goos: [ windows ] goos: [ windows ]
goarch: [amd64 ] goarch: [ amd64 ]
- - id: ntfy_darwin_all
id: ntfy_darwin_all
binary: ntfy binary: ntfy
env: env:
- CGO_ENABLED=0 # explicitly disable, since we don't need go-sqlite3 - CGO_ENABLED=0 # explicitly disable, since we don't need go-sqlite3
@ -67,8 +66,8 @@ builds:
goarch: [ amd64, arm64 ] # will be combined to "universal binary" (see below) goarch: [ amd64, arm64 ] # will be combined to "universal binary" (see below)
nfpms: nfpms:
- package_name: ntfy - package_name: ntfy
homepage: https://heckel.io/ntfy homepage: https://ntfy.sh
maintainer: Philipp C. Heckel <philipp.heckel@gmail.com> maintainer: Philipp C. Heckel <phil@mail.ntfy.sh>
description: Simple pub-sub notification service description: Simple pub-sub notification service
license: Apache 2.0 license: Apache 2.0
formats: formats:
@ -148,59 +147,22 @@ changelog:
exclude: exclude:
- '^docs:' - '^docs:'
- '^test:' - '^test:'
dockers: dockers_v2:
- image_templates: - dockerfile: Dockerfile
- &amd64_image "binwiederhier/ntfy:{{ .Tag }}-amd64" ids:
use: buildx - ntfy_linux_amd64
dockerfile: Dockerfile - ntfy_linux_armv6
goarch: amd64 - ntfy_linux_armv7
build_flag_templates: - ntfy_linux_arm64
- "--platform=linux/amd64" images:
- image_templates: - "binwiederhier/ntfy"
- &arm64v8_image "binwiederhier/ntfy:{{ .Tag }}-arm64v8" tags:
use: buildx - "latest"
dockerfile: Dockerfile-arm - "{{ .Tag }}"
goarch: arm64 - "v{{ .Major }}"
build_flag_templates: - "v{{ .Major }}.{{ .Minor }}"
- "--platform=linux/arm64/v8" platforms:
- image_templates: - linux/amd64
- &armv7_image "binwiederhier/ntfy:{{ .Tag }}-armv7" - linux/arm64
use: buildx - linux/arm/v7
dockerfile: Dockerfile-arm - linux/arm/v6
goarch: arm
goarm: 7
build_flag_templates:
- "--platform=linux/arm/v7"
- image_templates:
- &armv6_image "binwiederhier/ntfy:{{ .Tag }}-armv6"
use: buildx
dockerfile: Dockerfile-arm
goarch: arm
goarm: 6
build_flag_templates:
- "--platform=linux/arm/v6"
docker_manifests:
- name_template: "binwiederhier/ntfy:latest"
image_templates:
- *amd64_image
- *arm64v8_image
- *armv7_image
- *armv6_image
- name_template: "binwiederhier/ntfy:{{ .Tag }}"
image_templates:
- *amd64_image
- *arm64v8_image
- *armv7_image
- *armv6_image
- name_template: "binwiederhier/ntfy:v{{ .Major }}"
image_templates:
- *amd64_image
- *arm64v8_image
- *armv7_image
- *armv6_image
- name_template: "binwiederhier/ntfy:v{{ .Major }}.{{ .Minor }}"
image_templates:
- *amd64_image
- *arm64v8_image
- *armv7_image
- *armv6_image

View file

@ -1,6 +1,9 @@
FROM --platform=$BUILDPLATFORM alpine AS tzdata
RUN apk add --no-cache tzdata
FROM alpine FROM alpine
LABEL org.opencontainers.image.authors="philipp.heckel@gmail.com" LABEL org.opencontainers.image.authors="Philipp C. Heckel <phil@mail.ntfy.sh>"
LABEL org.opencontainers.image.url="https://ntfy.sh/" LABEL org.opencontainers.image.url="https://ntfy.sh/"
LABEL org.opencontainers.image.documentation="https://docs.ntfy.sh/" LABEL org.opencontainers.image.documentation="https://docs.ntfy.sh/"
LABEL org.opencontainers.image.source="https://github.com/binwiederhier/ntfy" LABEL org.opencontainers.image.source="https://github.com/binwiederhier/ntfy"
@ -9,8 +12,13 @@ LABEL org.opencontainers.image.licenses="Apache-2.0, GPL-2.0"
LABEL org.opencontainers.image.title="ntfy" 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.description="Send push notifications to your phone or desktop using PUT/POST"
RUN apk add --no-cache tzdata ARG TARGETPLATFORM
COPY ntfy /usr/bin
# Install tzdata in a separate stage using the build platform to avoid
# needing QEMU to run "apk add" for non-native target architectures
COPY --from=tzdata /usr/share/zoneinfo /usr/share/zoneinfo
COPY $TARGETPLATFORM/ntfy /usr/bin/ntfy
EXPOSE 80/tcp EXPOSE 80/tcp
ENTRYPOINT ["ntfy"] ENTRYPOINT ["ntfy"]

View file

@ -1,18 +0,0 @@
FROM alpine
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/"
LABEL org.opencontainers.image.source="https://github.com/binwiederhier/ntfy"
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"
# Alpine does not support adding "tzdata" on ARM anymore, see
# https://github.com/binwiederhier/ntfy/issues/894
COPY ntfy /usr/bin
EXPOSE 80/tcp
ENTRYPOINT ["ntfy"]