You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
... the documentation does not mention anything about my problem
... there are no open or closed issues that are related to my problem
Description
I am trying to build a multiplatform image (linux + windows). The image build succeeds, but when I try to pin base images using --build-context, the build fails because buildx seemingly (?) attempts to load the specified build context for all platforms, instead of only for the platforms that are actually required.
Expected behaviour
When specifying a context with --build-context, the context should only be loaded for platforms that are actually used, not all platforms specified on the commandline.
Actual behaviour
The build fails because buildx attempts to load the --build-context for a platform that it does not have a manifest for (in my specific example, it attempts to load alpine:3 for windows/amd64).
$ docker buildx build . --platform "linux/amd64,windows/amd64" --build-context "docker.io/library/alpine:3=docker-image://docker.io/library/alpine:3" --progress=plain#0 building with "gallant_hopper" instance using docker-container driver#1 [internal] load build definition from Dockerfile#1 transferring dockerfile: 190B done#1 DONE 0.0s#2 [windows/amd64 internal] load metadata for mcr.microsoft.com/windows/nanoserver:ltsc2025#2 DONE 0.1s#3 [context alpine:3] load metadata for docker.io/library/alpine:3#3 ERROR: no match for platform in manifest: not found#4 [context alpine:3] load metadata for docker.io/library/alpine:3#4 DONE 0.5s------ > [context alpine:3] load metadata for docker.io/library/alpine:3:------WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --loadDockerfile:1-------------------- 1 | >>> FROM docker.io/library/alpine:3 AS container-linux 2 | FROM mcr.microsoft.com/windows/nanoserver:ltsc2025 AS container-windows 3 | --------------------ERROR: failed to solve: failed to resolve source metadata for docker.io/library/alpine:3: no match for platform in manifest: not found
Build logs
Additional info
No response
The text was updated successfully, but these errors were encountered:
Contributing guidelines
I've found a bug and checked that ...
Description
I am trying to build a multiplatform image (linux + windows). The image build succeeds, but when I try to pin base images using
--build-context
, the build fails because buildx seemingly (?) attempts to load the specified build context for all platforms, instead of only for the platforms that are actually required.Expected behaviour
When specifying a context with
--build-context
, the context should only be loaded for platforms that are actually used, not all platforms specified on the commandline.Actual behaviour
The build fails because buildx attempts to load the
--build-context
for a platform that it does not have a manifest for (in my specific example, it attempts to loadalpine:3
forwindows/amd64
).Buildx version
github.com/docker/buildx v0.18.0
Docker info
Builders list
Configuration
The following works as expected
docker buildx build . --platform "linux/amd64,windows/amd64"
Combining
--platform
with--build-context
failsBuild logs
Additional info
No response
The text was updated successfully, but these errors were encountered: