Open Shaked opened 1 year ago
I'm not able to repro:
docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
builder docker-container
builder0 unix:///var/run/docker.sock running v0.12.0 linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
default * docker
default default running v0.11.7-0.20230525183624-798ad6b0ce9f linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
$ docker buildx --builder builder build -t crazymax/buildx:1924-container --push .
...
$ docker buildx imagetools inspect crazymax/buildx:1924-container --format "{{json .Image.Architecture}}"
"arm64"
$ docker buildx --builder default build -t crazymax/buildx:1924-docker --push .
...
$ docker buildx imagetools inspect crazymax/buildx:1924-docker --format "{{json .Image.Architecture}}"
"arm64"
Even when specifying preferred platforms like you do:
$ docker buildx create --platform "linux/arm64,linux/amd64" --name mirrored --use
$ docker buildx --builder mirrored build -t crazymax/buildx:1924-mirrored --push .
...
$ docker buildx imagetools inspect crazymax/buildx:1924-mirrored --format "{{json .Image.Architecture}}"
"arm64"
The endpoint tcp://localhost:2375
of your mirrored
builder looks a bit odd to me. Can you show the output of docker context ls
command?
Contributing guidelines
I've found a bug and checked that ...
Description
Hi
I am trying to build the following Dockerfile on a x86 machine:
The image above is only available for
arm64
as you can see on Nvidia's website.I have created a builder:
And then I ran a build and inspect its architecture, it seems to be correct:
When I use
--push
instead of--load
, I see that the pushed image's architecture is nowamd64
and thearm64
is not available:This can be seen in the registry's manifest:
When I run the same with the default
docker
driver, it seems to work as expected and I end up with anarm64
image pushed to the registry.Only when I use a
--platform linux/arm64
thedocker-container
driver pushes the correct image to the registry.Is this a bug? Am I missing something or maybe it's intentional?
Thank you
Expected behaviour
The
docker-container
driver should push the correct platform automatically even when--platform
is not stated explicitly. The same has with thedocker
driver.Actual behaviour
Pushing an arm64-based image to a remote registry using the
docker-container
driver on a x86 machine ends up as amd64 instead of arm64 like when using thedocker
driver.Buildx version
github.com/docker/buildx v0.11.0 687feca9e8dcd1534ac4c026bc4db5a49de0dd6e
Docker info
Builders list
Configuration
Build logs
Additional info
No response