Repository navigation
build: publish Docker images with GoReleaser - #768
Merged
dwisiswant0 merged 2 commits intoOct 8, 2026
Merged
Conversation
Build and push the Docker image in the release workflow, and remove the separate Docker Hub workflow that rebuilt the image after "🎉 Release Binary" finished. GoReleaser now builds the image with dockers_v2 from the binaries it compiles in the same run. The Dockerfile no longer builds proxify. It copies $TARGETPLATFORM/proxify from the GoReleaser build context and sets OCI labels. dockers_v2 replaces the deprecated dockers and docker_manifests. Rename release-binary.yml to release.yml and the workflow to "🎉 Release", since it now publishes images too. The workflow logs in to Docker Hub and switches from actions/setup-go and goreleaser/goreleaser-action to projectdiscovery/actions/setup/go and projectdiscovery/actions/goreleaser. With release: true, the goreleaser action sets up QEMU and Buildx before it runs goreleaser release. Tag images with the release tag, vX.Y, vX and latest. The old workflow pushed only the release tag and latest. Disable image builds for snapshot runs in CI. release-test runs a snapshot release on runners without QEMU, and image builds would fail there. Local snapshot runs still build images. Removing the old workflow also removes its workflow_dispatch trigger, so images can no longer be re-pushed without a release run. Build the 32-bit ARM image for linux/arm/v6 instead of linux/arm. GoReleaser stores the default GOARM=6 binary under linux/arm/v6, but buildx resolves linux/arm to arm/v7, where there is no binary. armv7 hosts can still run the arm/v6 image. Set CGO_ENABLED=0 on all three builds, so that the linux/amd64 binaries are static and run on Alpine. The linux/amd64 archive gets the same static binaries. The image still contains only proxify. Copying the GoReleaser binary also fixes the image build. The old Dockerfile compiled with golang:1.24.0-alpine, which cannot build a module that requires Go 1.25.0. Add version: 2 and replace the deprecated archives format key with formats; goreleaser check flagged both. Archive names do not change. Closes #766 Fixes #767 Signed-off-by: Dwi Siswanto <git@dw1.io>
This was
linked to
issues
Oct 7, 2026
Closed
Mzack9999
approved these changes
Oct 7, 2026
Mzack9999
left a comment
Member
There was a problem hiding this comment.
This matches the request. The image is built from the release binaries in the same GoReleaser run, with the release tag, vX.Y, vX, and latest.
dwisiswant0
deleted the
dwisiswant0/build/publish-docker-images-with-goreleaser
branch
October 8, 2026 09:49
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.
Proposed changes
Build and push the Docker image in the release workflow, and remove the separate Docker Hub workflow that rebuilt the image after "🎉 Release Binary" finished.
GoReleaser now builds the image with dockers_v2 from the binaries it compiles in the same run. The Dockerfile no longer builds proxify. It copies $TARGETPLATFORM/proxify from the GoReleaser build context and sets OCI labels. dockers_v2 replaces the deprecated dockers and docker_manifests.
Rename release-binary.yml to release.yml and the workflow to "🎉 Release", since it now publishes images too. The workflow logs in to Docker Hub and switches from actions/setup-go and goreleaser/goreleaser-action to projectdiscovery/actions/setup/go and projectdiscovery/actions/goreleaser. With release: true, the goreleaser action sets up QEMU and Buildx before it runs goreleaser release.
Tag images with the release tag, vX.Y, vX and latest. The old workflow pushed only the release tag and latest.
Disable image builds for snapshot runs in CI. release-test runs a snapshot release on runners without QEMU, and image builds would fail there. Local snapshot runs still build images.
Removing the old workflow also removes its workflow_dispatch trigger, so images can no longer be re-pushed without a release run.
Build the 32-bit ARM image for linux/arm/v6 instead of linux/arm. GoReleaser stores the default GOARM=6 binary under linux/arm/v6, but buildx resolves linux/arm to arm/v7, where there is no binary. armv7 hosts can still run the arm/v6 image.
Set CGO_ENABLED=0 on all three builds, so that the linux/amd64 binaries are static and run on Alpine. The linux/amd64 archive gets the same static binaries. The image still contains only proxify.
Copying the GoReleaser binary also fixes the image build. The old Dockerfile compiled with golang:1.24.0-alpine, which cannot build a module that requires Go 1.25.0.
Add version: 2 and replace the deprecated archives format key with formats; goreleaser check flagged both. Archive names do not change.
Supersedes #760.
Closes #766
Fixes #767
Checklist