Skip to content

Fix multi-arch Dockerfile COPY (v1.2.1 release failure)#19

Merged
cjimti merged 1 commit into
masterfrom
fix-dockerfile-multiarch-copy
Jun 17, 2026
Merged

Fix multi-arch Dockerfile COPY (v1.2.1 release failure)#19
cjimti merged 1 commit into
masterfrom
fix-dockerfile-multiarch-copy

Conversation

@cjimti

@cjimti cjimti commented Jun 17, 2026

Copy link
Copy Markdown
Member

What broke

The v1.2.1 release failed at GoReleaser's dockers_v2 step:

docker images (v2): failed to publish artifacts: exit status 1
Seems like you tried to copy a file that is not available in the build context.
/tmp/goreleaserdocker...
├── Dockerfile
└── linux
    ├── amd64/rtbeat
    └── arm64/rtbeat

GoReleaser stages each binary under a ${TARGETPLATFORM} path in the multi-platform build context, but the Dockerfile did COPY rtbeat /rtbeat — nothing exists at the context root, so the build failed with "/rtbeat": not found.

Fix

Add ARG TARGETPLATFORM and copy ${TARGETPLATFORM}/rtbeat, matching the working kubefwd Dockerfile pattern. One file, one line of substance.

ARG TARGETPLATFORM
COPY ${TARGETPLATFORM}/rtbeat /rtbeat

Verification (locally, before asking for a re-tag)

  • Reproduced the original failure: the old COPY rtbeat /rtbeat fails with "/rtbeat": not found; the fixed Dockerfile builds for both linux/amd64 and linux/arm64 via docker buildx.
  • Ran the full GoReleaser pipeline in snapshot mode (release --snapshot): binaries, archives, Homebrew formula, and the multi-arch docker images all build successfully (release succeeded).

Not verifiable locally (CI-only, secrets required): the GHCR push, image cosign-signing, Homebrew-tap push, and SLSA provenance. GHCR login + packages: write already succeeded in the failed run, so these are the only residual unknowns.

After merge

The v1.2.1 tag points at the pre-fix commit (and the failed run left no release object or pushed image). Delete the stale v1.2.1 tag, then re-tag v1.2.1 on the fixed master.

GoReleaser's dockers_v2 multi-platform build stages each binary under a
${TARGETPLATFORM} path in the build context (linux/amd64/rtbeat,
linux/arm64/rtbeat), so `COPY rtbeat /rtbeat` finds nothing at the
context root — the v1.2.1 release failed with "/rtbeat: not found".

Add `ARG TARGETPLATFORM` and copy `${TARGETPLATFORM}/rtbeat`, matching
the working kubefwd Dockerfile. Verified locally with buildx for both
linux/amd64 and linux/arm64.
@cjimti cjimti merged commit 3ad8c99 into master Jun 17, 2026
10 checks passed
@cjimti cjimti deleted the fix-dockerfile-multiarch-copy branch June 17, 2026 07:08
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