docker / docker/buildx

multi-node builder should not fallback to detected platform if node with manual platform errors

Open
#2,119 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement status/accepted
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

Description

Repro steps:

  1. Create a driver with this spec:
{"Name":"remote","Driver":"remote","Nodes":[{"Name":"remote0","Endpoint":"tcp://localhost:1234","Platforms":[{"architecture":"arm64","os":"linux"}],"Flags":null,"DriverOpts":null,"Files":null}
  1. Send a request to the builder for a different platform
docker buildx build -t out --platform linux/amd64 .
Expected result:

I would expect to fail because there's no available builder that matches the platform

Actual result:

buildx sends the request to the ARM builder

Additional info:

The full problem is more complicated, and involves how the Node fallback logic works when one of the builders is unavailable. Basically we're seeing problems where if platform isn't specified, and one of the builders is unavailable, the request ends up landing on a random Node and with a random Platform.

I think it would be fine if this behavior was opt-in, i.e., there was a driver opt like:

{"Name":"remote","DriverOpts":{"DefaultPlatform": "linux/amd64", "StrictPlatformMatching": true}}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the remote driver specification and the docker buildx build --platform linux/amd64 command, then trace the multi-node Node fallback logic when a builder is unavailable. Done means an explicitly requested platform does not fall back to a node with a conflicting manual platform, and the unavailable-node behavior is covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
build-system, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.