Conversation
There was a problem hiding this comment.
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
ignorerules 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 |
There was a problem hiding this comment.
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.
| COPY ${TARGETPLATFORM}/mercure /usr/bin/caddy | |
| COPY mercure /usr/bin/caddy |
| 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 |
There was a problem hiding this comment.
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:
- Verify that multi-platform Docker images build successfully
- Verify that the correct binaries are included in each platform-specific image
- Test that the resulting Docker images work on both amd64 and arm64 architectures
- Verify that all image tags are created correctly
Consider adding a test build in CI to validate the Docker image builds before releasing.
No description provided.