Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 39 additions & 51 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ release:
draft: true
env:
- CGO_ENABLED=0

builds:
- id: caddy
dir: caddy/mercure
Expand All @@ -36,7 +37,10 @@ builds:
- "5"
- "6"
- "7"
# Legacy build
ignore:
- goos: windows
goarch: arm

- id: legacy
dir: cmd/mercure
ldflags:
Expand All @@ -53,10 +57,15 @@ builds:
- amd64
- arm
- arm64
ignore:
- goos: windows
goarch: arm

upx:
- enabled: true
goos: [linux]
compress: best

archives:
- ids:
- caddy
Expand Down Expand Up @@ -93,62 +102,40 @@ archives:
format_overrides:
- goos: windows
formats: [zip]
dockers:
- ids:
- caddy
goos: linux
goarch: amd64
image_templates:
- "dunglas/mercure:{{ .Tag }}-amd64"
- "dunglas/mercure:v{{ .Major }}-amd64"
- "dunglas/mercure:v{{ .Major }}.{{ .Minor }}-amd64"
- "dunglas/mercure:latest-amd64"
use: buildx
build_flag_templates:
- "--platform=linux/amd64"
extra_files:
- Caddyfile
- dev.Caddyfile
- ids:

dockers_v2:
- id: caddy
ids:
- caddy
goos: linux
goarch: arm64
image_templates:
- "dunglas/mercure:{{ .Tag }}-arm64v8"
- "dunglas/mercure:v{{ .Major }}-arm64v8"
- "dunglas/mercure:v{{ .Major }}.{{ .Minor }}-arm64v8"
- "dunglas/mercure:latest-arm64v8"
use: buildx
build_flag_templates:
- "--platform=linux/arm64/v8"
images:
- "dunglas/mercure"
tags:
- "{{ .Tag }}"
- "v{{ .Major }}"
- "v{{ .Major }}.{{ .Minor }}"
- "latest"
platforms:
- linux/amd64
- linux/arm64/v8
extra_files:
- Caddyfile
- dev.Caddyfile
- ids:

- id: legacy
ids:
- legacy
dockerfile: Dockerfile.legacy
image_templates:
- "dunglas/mercure:legacy-{{ .Tag }}"
- "dunglas/mercure:legacy-v{{ .Major }}"
- "dunglas/mercure:legacy-v{{ .Major }}.{{ .Minor }}"
- "dunglas/mercure:legacy-latest"
docker_manifests:
- name_template: dunglas/mercure:{{ .Tag }}
image_templates:
- dunglas/mercure:{{ .Tag }}-amd64
- dunglas/mercure:{{ .Tag }}-arm64v8
- name_template: dunglas/mercure:v{{ .Major }}
image_templates:
- dunglas/mercure:v{{ .Major }}-amd64
- dunglas/mercure:v{{ .Major }}-arm64v8
- name_template: dunglas/mercure:v{{ .Major }}.{{ .Minor }}
image_templates:
- dunglas/mercure:v{{ .Major }}.{{ .Minor }}-amd64
- dunglas/mercure:v{{ .Major }}.{{ .Minor }}-arm64v8
- name_template: dunglas/mercure:latest
image_templates:
- dunglas/mercure:latest-amd64
- dunglas/mercure:latest-arm64v8
images:
- "dunglas/mercure"
tags:
- "legacy-{{ .Tag }}"
- "legacy-v{{ .Major }}"
- "legacy-v{{ .Major }}.{{ .Minor }}"
- "legacy-latest"
platforms:
- linux/amd64
- linux/arm64/v8
Comment on lines +106 to +137
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a significant architectural change migrating from the legacy dockers + docker_manifests approach to the newer dockers_v2 configuration. While this is a good modernization, the change should be thoroughly tested before merging, particularly:

  1. Verify that multi-platform Docker images build successfully
  2. Verify that the correct binaries are included in each platform-specific image
  3. Test that the resulting Docker images work on both amd64 and arm64 architectures
  4. Verify that all image tags are created correctly

Consider adding a test build in CI to validate the Docker image builds before releasing.

Copilot uses AI. Check for mistakes.

nfpms:
- id: linux_packages
package_name: mercure
Expand All @@ -165,6 +152,7 @@ nfpms:
vendor: "Dunglas Services SAS"
homepage: "https://mercure.rocks"
bindir: /usr/bin

signs:
- artifacts: checksum
args:
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# syntax=docker/dockerfile:1
FROM caddy:2-alpine

ARG TARGETPLATFORM

LABEL org.opencontainers.image.title=Mercure.rocks
LABEL org.opencontainers.image.description="Real-time made easy"
LABEL org.opencontainers.image.url=https://mercure.rocks
LABEL org.opencontainers.image.source=https://github.com/dunglas/mercure
LABEL org.opencontainers.image.licenses=AGPL-3.0-or-later
LABEL org.opencontainers.image.vendor="Kévin Dunglas"

COPY mercure /usr/bin/caddy
COPY ${TARGETPLATFORM}/mercure /usr/bin/caddy
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Dockerfile COPY statement uses ${TARGETPLATFORM}/mercure, but this path format is not how GoReleaser organizes built binaries. GoReleaser's dockers_v2 feature expects binaries to be in the dist directory organized by artifact name, not by TARGETPLATFORM. The typical pattern for dockers_v2 is to use COPY mercure /usr/bin/caddy without the platform prefix, as GoReleaser automatically handles the multi-platform binary selection during the Docker build process. This change may cause the Docker build to fail because the binary won't be found at the specified path.

Suggested change
COPY ${TARGETPLATFORM}/mercure /usr/bin/caddy
COPY mercure /usr/bin/caddy

Copilot uses AI. Check for mistakes.
COPY Caddyfile /etc/caddy/Caddyfile
COPY dev.Caddyfile /etc/caddy/dev.Caddyfile
Loading