docker / for-mac

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

[bug] Rosetta 2 not working in Docker Desktop on MacOS Sequoia #7322

Closed devantler closed 2 months ago

devantler commented 3 months ago

Description

It seems Docker Desktop does not correctly enable Rosetta 2 on the new dev beta for MacOs 15.

Screenshot 2024-06-11 at 16 51 54

ยด

Reproduce

  1. Install MacOS 15 dev beta
  2. Enable Use Rosetta for x86_64/amd64 emulation on Apple Silicon
  3. Run a docker image that relies on AMD64.

Expected behavior

I would expect Rosetta to handle the incompatibility and run the image.

docker version

Client:
 Version:           26.1.4
 API version:       1.45
 Go version:        go1.21.11
 Git commit:        5650f9b
 Built:             Wed Jun  5 11:26:02 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.31.0 (153195)
 Engine:
  Version:          26.1.4
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.11
  Git commit:       de5c9cf
  Built:            Wed Jun  5 11:29:12 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.33
  GitCommit:        d2d58213f83a351ca8f528a95fbd145f5654e957
 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.4
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.1-desktop.1
    Path:     /Users/nikolaiemildamm/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.1-desktop.1
    Path:     /Users/nikolaiemildamm/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.32
    Path:     /Users/nikolaiemildamm/.docker/cli-plugins/docker-debug
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/nikolaiemildamm/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.24
    Path:     /Users/nikolaiemildamm/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/nikolaiemildamm/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.2.0
    Path:     /Users/nikolaiemildamm/.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/nikolaiemildamm/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.9.3
    Path:     /Users/nikolaiemildamm/.docker/cli-plugins/docker-scout

Server:
 Containers: 7
  Running: 7
  Paused: 0
  Stopped: 0
 Images: 4
 Server Version: 26.1.4
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 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: d2d58213f83a351ca8f528a95fbd145f5654e957
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.6.31-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 7
 Total Memory: 7.755GiB
 Name: docker-desktop
 ID: 8941d88b-cd2d-4f21-919e-3f569ce67011
 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/nikolaiemildamm/Library/Containers/com.docker.docker/Data/docker-cli.sock
 Experimental: false
 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

0713F31F-ECCA-4FC3-A712-3AAD558ED930/20240611144733

Additional Info

image

image

image

image

dgageot commented 3 months ago

Hi @devantler, sorry for breaking your workflow. We have a fix. I'll share a build with you as soon as it's ready.

devantler commented 3 months ago

Thanks @dgageot ๐Ÿฅ‡

lehcosta commented 3 months ago

@dgageot same here.

vyconm commented 3 months ago

can confirm same on Developer Beta 1. Can you share that build @dgageot ? Thanks.

dgageot commented 3 months ago

Here's an internal build you can try: Docker.dmg

KosyoK1104 commented 3 months ago

Here's an internal build you can try: Docker.dmg

Will this update the currently installed Docker or we need to remove it and then install it?

devantler commented 3 months ago

I am testing it now. Will return in a sec :-)

I assume you just need to:

  1. Close docker
  2. Run the .dmg file
  3. Replace your current application
  4. Run docker again.

[!NOTE] On MacOS Sequoia you need to allow the app to run in System Settings > Privacy and Security:

image

Edit: closed by mistake, sorry.. :-)

devantler commented 3 months ago

It works! Thanks, @dgageot ๐Ÿ™Œ๐Ÿป

Will you do a proper release one of the coming days, or will we have to wait for the public release of MacOS 15 for that? ๐Ÿ‘€

dgageot commented 3 months ago

@devantler we have a release in about 2 or 3 weeks. This fix will ship with it.

testerpool commented 3 months ago

I had a similar problem as the author, it was solved by installing your application! I already wanted to roll back to Sonoma. Thank you very much)

juliomachado commented 3 months ago

Hi guys.

I'm having the exact same scenario. Uninstalled Docker completely, installed the .dmg provided in the link above but still can run mcr.microsoft.com/mssql/server:2022-latest image based container.

sudo docker pull mcr.microsoft.com/mssql/server:2022-latest
udo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=<pass>" -p 1434:1434 --name sql2022 --hostname sql2022 -d mcr.microsoft.com/mssql/server:2022-latest

Log is shown as this:

2024-06-13 18:14:15 SQL Server 2022 will run as non-root by default.
2024-06-13 18:14:15 This container is running as user mssql.
2024-06-13 18:14:15 To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.

Any step I'm missing?

Thanks.

alexdecoder commented 3 months ago

I actually tried to run the same container with the same result. Issues with Rosetta on 14.5, so I thought I would try 15... Much worse issues.

On Thu, Jun 13, 2024, 5:16โ€ฏPM Julio Cesar Machado @.***> wrote:

Hi guys.

I'm having the exact same scenario. Uninstalled Docker completely, installed the .dmg provided in the link above but still can run mcr.microsoft.com/mssql/server:2022-latest image based container.

sudo docker pull mcr.microsoft.com/mssql/server:2022-latest udo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=" -p 1434:1434 --name sql2022 --hostname sql2022 -d mcr.microsoft.com/mssql/server:2022-latest

Log is shown as this:

2024-06-13 18:14:15 SQL Server 2022 will run as non-root by default. 2024-06-13 18:14:15 This container is running as user mssql. 2024-06-13 18:14:15 To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.

Any step I'm missing?

Thanks.

โ€” Reply to this email directly, view it on GitHub https://github.com/docker/for-mac/issues/7322#issuecomment-2166808870, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACS5RQPNYVZLNHTSR5VROJ3ZHIDZZAVCNFSM6AAAAABJEQLNNSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRWHAYDQOBXGA . You are receiving this because you commented.Message ID: @.***>

Barrow099 commented 3 months ago

Tried the internal build, rosetta emulation seems to be working fine

kobynz commented 3 months ago

I also use a MS SQL 2022 container for development (mcr.microsoft.com/mssql/server:2022-latest) which is amd64 only.

That build you posted allowed me to get past the rosetta error, but the container crashes immediately on start with Exit Code 132, which point to an Illegal instruction issue.

This all used to work perfectly for me on mac os 14.5, so I think something is still unresolved here.

devantler commented 3 months ago

If you are having the SQL2022 issue, you can use the azure edge image in the meantime :-)

docker run --cap-add SYS_PTRACE -e 'ACCEPT_EULA=1' -e 'MSSQL_SA_PASSWORD=yourStrong(!)Password' -p 1433:1433 --name azuresqledge -d mcr.microsoft.com/azure-sql-edge

I think the only difference is some licensing, but it should be fine for local development, which is what I assume is troubling you guys here โœŒ๐Ÿป

kobynz commented 3 months ago

A good suggestion for many, but Azure Edge SQL doesn't support many features, including spatial data types, which I require. ๐Ÿ˜’

devantler commented 3 months ago

A good suggestion for many, but Azure Edge SQL doesn't support many features, including spatial data types, which I require. ๐Ÿ˜’

Ah, I was not aware. I hope it helps some of you ๐Ÿ™Œ๐Ÿป

juliomachado commented 3 months ago

Thanks for your suggestion, @devantler, but I also need specific SQL Server 2022 features. Azure Edge SQL works fine, as mentioned, but it doesn't fit my needs.

Maybe we can expect another internal build from @dgageot addressing this SQL Server 2022 issue :-)

Lets wait.

juliomachado commented 3 months ago

Hi guys!

Can we expect some evolution in this issue, regarding mcr.microsoft.com/mssql/server:2022-latest image?

vyconm commented 3 months ago

The shared docker image worked fine for me (15 Dev Beta 1) until today, where I ran into a signal 4 SIGILL in a python-3.9.7 Linux/x86/amd64 container being virtualized into macOS/arm64 via rosetta 2. Disabling rosetta restores functionality - unfortunately I don't know anything about python, and my colleagues have no idea what could have gone wrong, as it is a fairly generic memory issue. Here is some info and logs in the hopes that it somehow helps / may help anyone ;)

macOS 15.0 Beta (24A5264n) [Dev Beta 1] M1Max 2021 MacBook Pro

As far as I understand, a celery worker is crashing while executing something called billiard/pool.py, where it is trying to convert an image into a thumbnail size AVIF. SIGILL is pointing towards something in memory, I think - an illegal instruction maybe?

api-celery-1 | """ api-celery-1 | [2024-06-17 14:11:26,152: ERROR/MainProcess] Process 'ForkPoolWorker-27' pid:284 exited with 'signal 4 (SIGILL)' api-celery-1 | [2024-06-17 14:11:26,166: ERROR/MainProcess] Task handler raised error: WorkerLostError('Worker exited prematurely: signal 4 (SIGILL) Job: 22.') api-celery-1 | Traceback (most recent call last): api-celery-1 | File "/usr/local/lib/python3.9/site-packages/billiard/pool.py", line 1264, in mark_as_worker_lost api-celery-1 | raise WorkerLostError( api-celery-1 | billiard.einfo.ExceptionWithTraceback: api-celery-1 | """ api-celery-1 | Traceback (most recent call last): api-celery-1 | File "/usr/local/lib/python3.9/site-packages/billiard/pool.py", line 1264, in mark_as_worker_lost api-celery-1 | raise WorkerLostError( api-celery-1 | billiard.exceptions.WorkerLostError: Worker exited prematurely: signal 4 (SIGILL) Job: 22.

EDIT: fixed in Dev Beta 2.

vyconm commented 3 months ago

can confirm a similar illegal instruction problem when trying to build with vite in a docker container (node). Tried getting more logging from vite, but unfortunately it doesnt give me more than this.

=> ERROR [front builder 6/6] RUN npm run build 1.8s ------ > [front builder 6/6] RUN npm run build: 0.874 0.874 > front@0.1.0 build 0.874 > vite build --debug 0.874 1.796 Illegal instruction ------ failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 132

EDIT: fixed in Dev Beta 2.

juliomachado commented 3 months ago

Hello everyone.

Any status about SQL2022 image error (exit code: 132) issue?

ryan-roche commented 3 months ago

Perhaps you could spin the SQL2022 image error into its own Issue? I feel that the entire amd64 emulation functionality being broken on the upcoming version of macOS is urgent enough of an issue to get its own thread to itself.

dan-consignly commented 3 months ago

Hi all, I just wanted to share that the SQL Server 2022 image is working nicely again after updating to Beta 2.

CRdeGraaf commented 3 months ago

@dan-consignly i still have the issue on beta 2. Can you share details of what you're doing?

When i start mcr.microsoft.com/mssql/server:2022-latest on macos version 15.0 Beta (24A5279h) and docker 4.31.0 (153195)

sudo docker run -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=password" \
   -p 1433:1433 --name mssql --hostname mssql \
   -d \
   mcr.microsoft.com/mssql/server:2022-latest

it still causes

   2024-06-26 10:14:52  2024-06-26T08:16:35.726247842Z rosetta error: Rosetta is only intended to run on Apple Silicon with a macOS host using Virtualization.framework with Rosetta mode enabled

edit: mcr.microsoft.com/azure-sql-edge however still works

juliomachado commented 3 months ago

I'm running it fine with version 4.32.0, available above on @dgageot comment.

TrombeCryB commented 3 months ago

Here's an internal build you can try: Docker.dmg

thank you for your help

harsh8398 commented 3 months ago
image

I get this popup when I try to install the version @dgageot provided.

devantler commented 3 months ago
image

I get this popup when I try to install the version @dgageot provided.

MacOS Sequoia hardened security for unverified apps, and you will now have to do a bit more to open these. Check this video :-)

https://www.youtube.com/watch?v=Dykgs4bdjB0

paliwalgaurav commented 3 months ago

Working with internal build provided above.

Thanks @dgageot

bai commented 3 months ago

Running xattr -d com.apple.quarantine /Applications/Docker.app fixed security warnings I've been getting for that custom docker build (mentioned above) on Sequoia.

Joao-Marques commented 2 months ago

Here's an internal build you can try: Docker.dmg

I wasn't able to build any images from Mavens' Spring Boot integration and this fixed it for me. Thank you!

dgageot commented 2 months ago

Docker Desktop 4.32.0 is out! https://docs.docker.com/desktop/release-notes/#4320 Could you give it a try and see if it fixes your issue?

bai commented 2 months ago

@dgageot works perfectly, many thanks ๐Ÿ™

dgageot commented 2 months ago

I'm going to close this issue. Feel free to open another one if you have a related but different issue