Skip to content

chore: upgrade goreleaser config#1153

Open
dunglas wants to merge 1 commit intomainfrom
chore/upgrade-goreleaser-config
Open

chore: upgrade goreleaser config#1153
dunglas wants to merge 1 commit intomainfrom
chore/upgrade-goreleaser-config

Conversation

@dunglas
Copy link
Owner

@dunglas dunglas commented Jan 15, 2026

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR upgrades the GoReleaser configuration from the legacy dockers + docker_manifests approach to the modern dockers_v2 format. This modernization simplifies the Docker image build configuration and provides better support for multi-architecture images.

Changes:

  • Migrated Docker image configuration from separate per-architecture builds to unified multi-platform builds using dockers_v2
  • Added ignore rules to exclude Windows ARM builds
  • Updated Dockerfile to use platform-specific binary paths with TARGETPLATFORM
  • Added formatting improvements (blank lines) throughout the configuration

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
.goreleaser.yml Migrated from legacy dockers + docker_manifests to modern dockers_v2 configuration with platform specifications
Dockerfile Added TARGETPLATFORM argument and updated COPY statement to use platform-specific paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.
Comment on lines +106 to +137
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
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant