Skip to content

fix(relay): build the relay image like the compose binary - #14497

Merged
glours merged 1 commit into
docker:mainfrom
ndeloof:fix-relay-image-cross-compile
Nov 12, 2026
Merged

glours merged 1 commit into
docker:mainfrom
ndeloof:fix-relay-image-cross-compile

Conversation

@ndeloof

@ndeloof ndeloof commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Builds the relay image the way the compose binary is built, on the build platform and cross-compiled with xx, so that it no longer depends on which platforms the golang image publishes.

Context

Since the move to Go 1.27, the riscv64 leg of relay-image fails on main, and so does relay-image-test on every PR: golang:1.27.4-alpine has no linux/riscv64 variant (golang:1.26-alpine had one), and the relay's Dockerfile ran its Go toolchain stage on the target platform, so it pulled the image for riscv64.

The compose binary has no such problem. Its Dockerfile runs the toolchain on the build platform, from a pinned golang alpine image, and xx cross-compiles for the target. The relay was the one image built the other way.

What the PR brings

  • The relay's toolchain stage runs on the build platform, from the same pinned golang alpine image as the root Dockerfile, with xx-go cross-compiling for the target and xx-verify --static checking the result. No platform depends on what the golang image publishes.
  • The relay still ships for the same platforms, with the same static pure Go binaries. I built every platform of relay-image-cross locally (amd64, arm/v6, arm/v7, arm64, ppc64le, riscv64, s390x) and checked the architecture of each binary. The test stage also runs for riscv64 now, on the build platform.
  • A note at the top of the Dockerfile says to keep the versions in step with the root one, since the relay's Dockerfile has to repeat them (its build context is ./relay).

🤖 Generated with Claude Code

The relay image ran its Go toolchain stage on the target platform, so every
platform it ships for needed a golang:alpine image of its own. The
golang:1.27.4-alpine tag has no linux/riscv64 variant (1.26 had one), which
fails the riscv64 leg of relay-image and relay-image-test on main since the
move to Go 1.27.

Build it the way the compose binary is built: the toolchain runs on the build
platform, from the same pinned golang alpine image, and xx cross-compiles for
the target and checks that the result is static. No platform depends on what
the golang image publishes any more.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
ndeloof requested review from a team as code owners November 12, 2026 16:52

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours
glours merged commit 5c66699 into docker:main Nov 12, 2026
63 of 66 checks passed
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.

3 participants