Repository navigation
Run Dockerfile SDK stages on the build platform and publish for the target - #735
Merged
Merged
Conversation
…arget Every .NET Dockerfile now runs its SDK stage on $BUILDPLATFORM and passes -a $TARGETARCH to restore/build/publish, so building an image for another architecture no longer runs the .NET SDK under QEMU, where dotnet restore aborts. ClaudeCodeProxy's build stage (it only emits dist/ JavaScript) moves too; its final stage stays on the target platform. RockBot.Llm.Copilot sets IsRidAgnostic=false. GitHub.Copilot.SDK's targets live in build/, so they run only in this library, and pick the native CLI from its RuntimeIdentifier or else the build host. As a RID-agnostic project reference it had the agent's RID stripped, so a cross-arch publish bundled the host's Copilot CLI (an amd64 agent image built on arm64 shipped runtimes/linux-arm64/native/copilot). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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
deploy/Dockerfile.*,Dockerfile.scripts-manager, the fivesrc/McpServer.*,src/RockBot.UserProxy.Blazor) run their SDK stage on--platform=$BUILDPLATFORMand pass-a $TARGETARCHtorestore/build/publish.src/ClaudeCodeProxy/Dockerfile: the build stage (emits onlydist/JavaScript) moves to$BUILDPLATFORM; the final stage is unchanged.RockBot.Llm.Copilot.csproj:<IsRidAgnostic>false</IsRidAgnostic>so the referencing app's RID reaches it.Companion to #734, which does the same for
Dockerfile.browser.Why
Building any of these images for
linux/amd64on an ARM64 host ran the .NET SDK under QEMU, wheredotnet restoreaborts (qemu: uncaught target signal 6). With the SDK stage native and-a $TARGETARCH, only the final stage's smallRUNsteps (useradd,chown) are emulated.The Copilot CLI catch
GitHub.Copilot.SDK0.2.0 bundles a nativecopilotbinary and chooses its platform fromRuntimeIdentifier, falling back toNETCoreSdkPortableRuntimeIdentifier(the build host). Its targets are inbuild/, notbuildTransitive/, so they run only inRockBot.Llm.Copilot, which the agent consumes as a RID-agnostic project reference, and the .NET SDK stripsRuntimeIdentifierfrom those. The first pass of this change therefore produced an amd64 agent image carryingruntimes/linux-arm64/native/copilot. Today's images are correct only because they're built on x64 hosts.IsRidAgnostic=falselets the RID flow through; RID-less builds (localdotnet build, tests,dotnet pack) keep the build-host fallback exactly as before.Test plan
Run on an ARM64 Windows host (Docker Desktop, BuildKit):
linux/arm64andlinux/amd64, exceptclaude-code-proxyamd64: its unchanged final stage runs Claude'sinstall.sh, whose x64 binary aborts under QEMU. That image still needs an x64 host to build for amd64.runtimes/linux-*/native/copilot).rockylhotka/rockbot-agent:0.16.14-pr732-2.dotnet build RockBot.slnx(SDK 10),RockBot.Llm.Copilot.Tests12/12 passing,dotnet pack src/RockBot.Llm.Copilotsucceeds.🤖 Generated with Claude Code