Closed neilime closed 6 months ago
Ok I got a hard time to repro and was a bit confused but it seems to only happen when pushing a scratch image:
FROM scratch
$ docker buildx create --name foo
$ docker buildx --builder foo build --platform linux/amd64,linux/arm64 --tag crazymax/test:bpush-1024 --push .
...
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 50B done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.0s
#3 exporting to image
#3 ERROR: cannot export multiple platforms without multi-platform enabled
------
> exporting to image:
------
ERROR: failed to solve: cannot export multiple platforms without multi-platform enabled
~It seems related to this change https://github.com/moby/buildkit/pull/3321.~
EDIT: https://github.com/moby/buildkit/pull/3321 has been reverted in https://github.com/moby/buildkit/commit/063056313fd28e9ca8b35683e8f49a3d70da0fc5 so smth else.
Ok, I think I know what the issue is: https://github.com/moby/buildkit/blob/a960fe501f007d46facacae6f2a9e46c498552ed/solver/result/result.go#L162-L164.
This zero handling isn't quite right - when there's a zero value set in Ref/Refs, we should still be calling the target function in EachRef/Convert/etc. llb.Scratch
means that at some point, we end up with nil
in that map - which is a legitimate result, that we should properly handle.
The problem is - updating the Result
code to always call on the nil
case (since it is legitimate) means that a bunch of downstream code doesn't handle this, so all of the call sites need updating :cry:
Contributing guidelines
I've found a bug, and:
Description
I'm trying to use basic build with multi platform, I'm following the documentations, trying many settings, without success... Still having the following error:
Expected behaviour
Should be able to build multi platform images
Actual behaviour
Got an error
Repository URL
https://github.com/hoverkraft-tech/ci-github-container
Workflow run URL
https://github.com/hoverkraft-tech/ci-github-container/actions/runs/7170907680/job/19524710189
YAML workflow
Workflow logs
logs_1476.zip
BuildKit logs
Additional info
No response