[SDK-2337] Upgrade GoReleaser to v2.15 and simplify config with dockers_v2#661
Draft
aaron-zeisler wants to merge 4 commits into
Draft
[SDK-2337] Upgrade GoReleaser to v2.15 and simplify config with dockers_v2#661aaron-zeisler wants to merge 4 commits into
aaron-zeisler wants to merge 4 commits into
Conversation
…rs_v2 Replace the legacy dockers + docker_manifests configuration (36 image entries + 15 manifest entries) with the new dockers_v2 feature that handles multi-arch manifest creation natively via docker buildx. - Upgrade GoReleaser from v2.11.2 to v2.15.4 - Reduce .goreleaser.yml from 529 lines to 117 lines (77% reduction) - Use conditional tag templates instead of per-entry skip_push - Update Dockerfiles to use $TARGETPLATFORM for binary paths - Remove dead ldflags -X injection (Version is a const, not var) - Pin GoReleaser version ~> v2.15 in GitHub Actions Tracked by SDK-2337. Co-authored-by: Cursor <cursoragent@cursor.com>
…ge builds dockers_v2 builds multi-arch manifests via buildx, which can't --load into the local Docker daemon. The Docker Scout scan needs per-arch images available locally (e.g. ld-relay:8.19.1-amd64). Fix: use --snapshot mode for products-for-release, which causes GoReleaser to "explode" dockers_v2 into individual per-platform builds with --load and arch-suffixed tags. Add snapshot.version_template to preserve the current version string (instead of GoReleaser's default patch-increment behavior). Co-authored-by: Cursor <cursoragent@cursor.com>
…templates The dockers_v2 tag templates reference LD_RELEASER_UPDATE_MAJOR and LD_RELEASER_UPDATE_LATEST env vars. These are only set during the publish workflow but not during the CI security scan. GoReleaser's template engine fails with 'map has no entry for key' if they're missing. Set both to 'false' in the products-for-release target since we don't need major/latest tags for local CI builds. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dockers+docker_manifests(51 entries) withdockers_v2(3 entries).goreleaser.ymlfrom 529 lines to 117 lines (77% reduction)Motivation
The current GoReleaser config is 529 lines, with the vast majority being repetitive Docker image/manifest definitions (36
dockersentries + 15docker_manifestsentries). GoReleaser v2.12 introduceddockers_v2, which usesdocker buildxnatively to build multi-arch manifests in a single step — eliminating the need to separately define per-architecture images and then wire them together in manifests.This is an alternative to fully replacing GoReleaser (see #660). Instead of removing GoReleaser, this approach upgrades it and leverages new features to achieve the same goal of simplification.
Changes
.goreleaser.ymldockers_v2with conditional tag templatesDockerfile.goreleaserARG TARGETPLATFORM+COPY ${TARGETPLATFORM}/ld-relayDockerfile-static-debian12-nonroot.goreleaserDockerfile-static-debian12-debug-nonroot.goreleaser.github/actions/publish/action.yml~> v2.15, update artifact digest queryscripts/run-goreleaser.shv2.11.2→v2.15.4How dockers_v2 simplifies things
Before (legacy): Each Docker tag × architecture × variant required its own entry, with manual
skip_pushconditionals. Manifests were separately wired to reference the per-arch images by tag name.After (dockers_v2): One entry per Dockerfile variant. Tags use Go template conditionals (empty tags are ignored). GoReleaser + buildx handle multi-arch manifest creation automatically.
Other cleanup
ldflags(-X internal.version.Version={{.Version}}has no effect sinceVersionis aconst, not avar)"Docker Manifest"and"Docker Image"artifact typesTest plan
goreleaser checkon the new configimages_and_digests) is correctly populatedgoreleaser release --snapshot --cleanNote
dockers_v2is currently marked as experimental in GoReleaser and will become the defaultdockersin v3. The legacydockers+docker_manifestswill be deprecated at that point.JIRA
SDK-2337
Made with Cursor