This message was deleted.
# rancher-desktop
a
This message was deleted.
a
Copy code
docker buildx inspect --bootstrap           
Name:   qemu
Driver: docker-container

Nodes:
Name:      qemu0
Endpoint:  unix:///var/run/docker.sock
Status:    running
Platforms: linux/arm64, linux/amd64, linux/amd64/v2
Copy code
docker buildx build . --platform linux/amd64
...
cannot execute binary file: Exec format error
I've run these on a normal x86 machine and they worked fine. It's specific to the M1. It seems like the socket isn't running with rosetta or whatever is needed.
p
i don't use buildx but
docker build --platform linux/amd64 -t name .
works for me
a
docker build --platform linux/amd64 .
throws the same error
cannot execute binary file: Exec format error
f
@average-iron-93428 Do you also have Docker Desktop installed on your machine? The output above doesn't look like it comes from Rancher Desktop, which should produce something like this:
Copy code
% docker buildx inspect --bootstrap
Name:   default
Driver: docker

Nodes:
Name:      default
Endpoint:  default
Status:    running
Platforms: linux/arm64, linux/amd64
Maybe check
Copy code
% docker info | grep Name:
 Name: lima-rancher-desktop
Running both Docker and Rancher Desktop simultaneously is not really supported, but should work if you don't give Rancher Desktop admin permissions. In that case you can switch to the Rancher Desktop socket with
Copy code
% docker context use rancher-desktop
I do however still get problems from
buildx
on the M1 machine, but I'm still investigating those. But running
docker build --platform linux/amd64 .
works just fine.
a
@fast-garage-66093 I do have both installed but I'm using Rancher Desktop.
Copy code
docker info | grep Name:
 Name: lima-rancher-desktop
f
Then I don't understand the output of your
docker buildx inspect
command above.
p
make sure too that you are using the client it comes with:
Copy code
❯ which docker
/Users/xxxxx/.rd/bin/docker
f
Can you check
ls -l ~/.docker/cli-plugins
as well?
I had some old/broken symlinks in there that Rancher Desktop didn't update.
I suspect you may have the DD versions installed there
Copy code
% docker buildx version
<http://github.com/docker/buildx|github.com/docker/buildx> v0.8.2 6224def4dd2c3d347eee19db595348c50d7cb491
a
Copy code
which docker
/opt/homebrew/bin/docker
oh...look at that...
f
I don't think this matters as long as it is a fairly recent version
Copy code
% docker version
Client:
 Version:           20.10.16
 API version:       1.41
 Go version:        go1.17.10
 Git commit:        aa7e414
 Built:             Wed Jun  1 21:26:39 2022
 OS/Arch:           darwin/arm64
 Context:           rancher-desktop
 Experimental:      true

Server:
 Engine:
  Version:          20.10.16
  API version:      1.41 (minimum version 1.12)
a
Copy code
docker version
Client:
 Cloud integration: v1.0.25
 Version:           20.10.16
 API version:       1.41
 Go version:        go1.17.10
 Git commit:        aa7e414
 Built:             Thu May 12 09:20:34 2022
 OS/Arch:           darwin/arm64
 Context:           default
 Experimental:      true

Server:
 Engine:
  Version:          20.10.16
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.17.10
  Git commit:       f756502055d2e36a84f2068e6620bea5ecf09058
  Built:            Sun May 15 14:59:12 2022
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          v1.5.11
  GitCommit:        3df54a852345ae127d1fa3092b95168e4a88e2f8
 runc:
  Version:          1.1.2
  GitCommit:        
 docker-init:
  Version:          0.19.0
  GitCommit:
f
That all looks good
It works for me now, after running `docker buildx create --use`:
Copy code
% docker buildx build --platform=linux/arm64,linux/amd64 .
WARNING: No output specified for 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 --load
[+] Building 0.8s (8/8) FINISHED
 => [internal] load build definition from Dockerfile                                                                                          0.0s
 => => transferring dockerfile: 75B                                                                                                           0.0s
 => [internal] load .dockerignore                                                                                                             0.0s
 => => transferring context: 2B                                                                                                               0.0s
 => [linux/amd64 internal] load metadata for <http://docker.io/library/alpine:latest|docker.io/library/alpine:latest>                                                                  0.6s
 => [linux/arm64 internal] load metadata for <http://docker.io/library/alpine:latest|docker.io/library/alpine:latest>                                                                  0.4s
 => [linux/arm64 1/2] FROM <http://docker.io/library/alpine@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c|docker.io/library/alpine@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c>                   0.0s
 => => resolve <http://docker.io/library/alpine@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c|docker.io/library/alpine@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c>                               0.0s
 => [linux/amd64 1/2] FROM <http://docker.io/library/alpine@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c|docker.io/library/alpine@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c>                   0.2s
 => => resolve <http://docker.io/library/alpine@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c|docker.io/library/alpine@sha256:686d8c9dfa6f3ccfc8230bc3178d23f84eeaf7e457f36f271ab1acc53015037c>                               0.0s
 => => sha256:2408cc74d12b6cd092bb8b516ba7d5e290f485d3eb9672efc00f0583730179e8 2.80MB / 2.80MB                                                0.1s
 => => extracting sha256:2408cc74d12b6cd092bb8b516ba7d5e290f485d3eb9672efc00f0583730179e8                                                     0.0s
 => CACHED [linux/arm64 2/2] RUN echo "Hello" > /hello                                                                                        0.0s
 => [linux/amd64 2/2] RUN echo "Hello" > /hello                                                                                               0.1s
The fact that even
docker build --platform linux/amd64 .
doesn't work for you means that something is corrupted inside the VM. Can you do a Factory Reset (on the Troubleshooting page), and see if that fixes the issue?
562 Views