chore(docker): refactor goreleaser with YAML anchor and merge keys#1421
chore(docker): refactor goreleaser with YAML anchor and merge keys#1421kongfei605 merged 2 commits intoflashcatcloud:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the release packaging configuration by migrating the GoReleaser setup to v2-style keys/sections and consolidating Docker image builds into a single multi-arch Dockerfile flow.
Changes:
- Migrate
.goreleaser.yamltoversion: 2, refactor repeated build settings via YAML anchors, and switch Docker publishing todockers_v2. - Consolidate Docker image builds into
docker/Dockerfile.goreleaserusingTARGETPLATFORM-based binary selection and executable permissions via--chmod. - Remove the now-redundant
docker/Dockerfile.goreleaser.arm64.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
docker/Dockerfile.goreleaser.arm64 |
Removed the arm64-specific GoReleaser Dockerfile in favor of a single multi-arch Dockerfile. |
docker/Dockerfile.goreleaser |
Updated base image and refactored binary/entrypoint copies to be platform-aware and executable. |
.goreleaser.yaml |
Migrated config to v2 schema, introduced anchors, refactored archives, and replaced legacy docker/manifest config with dockers_v2. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - no_traces | ||
| - no_logs | ||
| ldflags: | ||
| ldflags: &ldflags_slim |
There was a problem hiding this comment.
The &ldflags_slim YAML anchor is defined here but never referenced elsewhere in the file. Either reference it (e.g., via ldflags: *ldflags_slim where applicable) or remove the anchor to avoid confusion during future edits.
| ldflags: &ldflags_slim | |
| ldflags: |
| ids: | ||
| - linux-slim | ||
| dockers_v2: | ||
| - &base_docker_v2 |
There was a problem hiding this comment.
&base_docker_v2 is declared as an anchor but isn’t reused (no *base_docker_v2 reference / merge key). If the intent is to DRY up multiple docker definitions, consider using <<: *base_docker_v2 on the other entries; otherwise remove the unused anchor.
| - &base_docker_v2 | |
| - |
| - id: categraf-slim | ||
| builds: | ||
| - linux-slim | ||
| format: tar.gz | ||
| format_overrides: | ||
| - goos: windows | ||
| format: zip | ||
| ids: | ||
| - linux-metrics-agent | ||
| formats: | ||
| - tar.gz |
There was a problem hiding this comment.
This change removes the linux-slim build and repoints the categraf-slim archive to linux-metrics-agent, which changes the produced “slim” artifact (previously linux-slim had additional build tags like no_prometheus). Please confirm this behavior change is intended; if “slim” should still exclude Prometheus, add the missing build tag(s) to linux-metrics-agent or restore a dedicated slim build.
No description provided.