docker / for-mac

Bug reports for Docker Desktop for Mac
https://www.docker.com/products/docker#/mac
2.43k stars 118 forks source link

[Apple Silicon] Inconsistent list of buildx platforms #7293

Open conradwt opened 4 months ago

conradwt commented 4 months ago

Description

When I install the buildx platforms using docker run --privileged --rm tonistiigi/binfmt --install all, I'm presented with the following output:

➜ docker run --privileged --rm tonistiigi/binfmt --install all
{
  "supported": [
    "linux/arm64",
    "linux/amd64",
    "linux/riscv64",
    "linux/ppc64le",
    "linux/s390x",
    "linux/386",
    "linux/mips64le",
    "linux/mips64",
    "linux/arm/v7",
    "linux/arm/v6"
  ],
  "emulators": [
    "arm",
    "i386",
    "mips64",
    "mips64le",
    "ppc64le",
    "riscv64",
    "rosetta",
    "rosetta-wrapper",
    "s390x",
    "x86_64"
  ]
}

However, when I list the platforms, I'm not seeing all of the supported platforms:

➜ docker buildx ls                         
NAME/NODE           DRIVER/ENDPOINT     STATUS    BUILDKIT   PLATFORMS
default*            docker                                   
 \_ default          \_ default         running   v0.13.2    linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64
desktop-linux       docker                                   
 \_ desktop-linux    \_ desktop-linux   running   v0.13.2    linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64

Finally, the following does complete with success:

docker buildx build --push --platform linux/amd64,linux/arm64,linux/arm/v7 -t $USER/silly-demo:v1.4.137 .

Reproduce

  1. sudo port install qemu
  2. docker buildx use default
  3. docker run --privileged --rm tonistiigi/binfmt --install all
  4. docker buildx ls

Expected behavior

I would expect the list of supported platforms to be in the output from docker buildx ls.

docker version

Client:
 Cloud integration: v1.0.35+desktop.13
 Version:           26.1.1
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        4cf5afa
 Built:             Tue Apr 30 11:44:56 2024
 OS/Arch:           darwin/arm64
 Context:           default

Server: Docker Desktop 4.30.0 (149282)
 Engine:
  Version:          26.1.1
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.9
  Git commit:       ac2de55
  Built:            Tue Apr 30 11:48:04 2024
  OS/Arch:          linux/arm64
  Experimental:     true
 containerd:
  Version:          1.6.31
  GitCommit:        e377cd56a71523140ca6ae87e30244719194a521
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    26.1.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.0-desktop.1
    Path:     /Users/conradwt/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.0-desktop.2
    Path:     /Users/conradwt/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.29
    Path:     /Users/conradwt/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/conradwt/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.23
    Path:     /Users/conradwt/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.4
    Path:     /Users/conradwt/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.1.0
    Path:     /Users/conradwt/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/conradwt/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.8.0
    Path:     /Users/conradwt/.docker/cli-plugins/docker-scout

Server:
 Containers: 1
  Running: 0
  Paused: 0
  Stopped: 1
 Images: 9
 Server Version: 26.1.1
 Storage Driver: overlayfs
  driver-type: io.containerd.snapshotter.v1
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: e377cd56a71523140ca6ae87e30244719194a521
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.26-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.657GiB
 Name: docker-desktop
 ID: 07df21f5-3d7a-4ed9-a708-f0966887c03e
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Labels:
  com.docker.desktop.address=unix:///Users/conradwt/Library/Containers/com.docker.docker/Data/docker-cli.sock
 Experimental: true
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

Diagnostics ID

F81BD35A-F90B-4B0E-A1A5-31E04EEF181F/20240525084643

Additional Info

N/A

conradwt commented 4 months ago

On BuildKit v0.13.2 using macOS 14.5 (Sonoma) Apple Silicon, I’m seeing the following:

linux/arm64, 
linux/amd64, 
linux/amd64/v2, 
linux/riscv64, 
linux/ppc64le, 
linux/s390x, 
linux/mips64le, 
linux/mips64

Note: I don't understand why the following are not included in the above:

linux/386, 
linux/arm/v7, 
linux/arm/v6

On BuildKit v0.12.5 using macOS 14.5 (Sonoma) Apple Silicon, I’m seeing the following:

linux/arm64, 
linux/amd64, 
linux/amd64/v2, 
linux/riscv64, 
linux/ppc64le, 
linux/s390x, 
linux/386, 
linux/mips64le, 
linux/mips64, 
linux/arm/v7, 
linux/arm/v6

On BuildKit v0.11.6 using macOS 11.7.10 (Big Sur) Intel, I’m seeing the following platform list:

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
thaJeztah commented 4 months ago

I think the arm variants don't require emulation. Not 100% sure on the 386 one.

Curious though why you're installing the binfmt binaries on Docker Desktop; on Docker Desktop these are already installed, so no manual setup should be needed; was there a specific issue you're trying to address?

conradwt commented 4 months ago

@thaJeztah Yes, the linux/arm64 don't require emulation because Apple SIlicon is using the arm64 instruction set. However, linux/arm/v6 and linux/arm/v7 are 32-bit architectures. Also, linux/386 is a 32-bit architecture.

I'm wondering, why is the builders linux/386, linux/arm/v7, and linux/arm/v6 are not listed for docker buildx ls?