Description
TLDR/fix: tick "Use Docker Compose V2" in general preferences
Or alternatively you can install Rosetta with softwareupdate --install-rosetta
if you really want to use docker-compose v1 but you more likely don't want either of those.
See Docker Desktop for Apple silicon - Known Issues
Seems that "Use Docker Compose V2" should be (and was) ticked out of the box but some recent automatic updated (?) turned it off in some cases, triggering this error out of the blue.
- I have tried with the latest version of Docker Desktop
- I have tried disabling enabled experimental features
- I have uploaded Diagnostics - no, it kept hanging on "Diagnosing..." for over 20 minutes so I gave up
Expected behavior
docker-compose works natively on Apple CPU (it was working flawlessly until now, without Rosetta).
Actual behavior
docker-compose fails with:
fork/exec /usr/local/bin/docker-compose-v1: bad CPU type in executable
Information
MacOS 12.2.1, Apple chip.
Docker Desktop 4.6.0 (fresh install).
Output of /Applications/Docker.app/Contents/MacOS/com.docker.diagnose check
[PASS] DD0027: is there available disk space on the host?
[PASS] DD0028: is there available VM disk space?
[PASS] DD0031: does the Docker API work?
[PASS] DD0004: is the Docker engine running?
[PASS] DD0011: are the LinuxKit services running?
[FAIL] DD0016: is the LinuxKit VM running? vm is not running: vm has not started
[PASS] DD0001: is the application running?
[PASS] DD0018: does the host support virtualization?
[FAIL] DD0017: can a VM be started? vm has not started: vm has not started
[PASS] DD0015: are the binary symlinks installed?
[PASS] DD0003: is the Docker CLI working?
[PASS] DD0013: is the $PATH ok?
[PASS] DD0007: is the backend responding?
[PASS] DD0014: are the backend processes running?
[PASS] DD0008: is the native API responding?
[PASS] DD0009: is the vpnkit API responding?
[PASS] DD0010: is the Docker API proxy responding?
[PASS] DD0012: is the VM networking working?
[PASS] DD0032: do Docker networks overlap with host IPs?
[SKIP] DD0030: is the image access management authorized?
[PASS] DD0019: is the com.docker.vmnetd process responding?
[PASS] DD0033: does the host have Internet access?
Not sure what's that VM issue here but seems unrelated? I can use Docker no problem, just docker-compose
fails
Steps to reproduce the behavior
Install Docker 4.6.0 on a M1 Mac and run docker-compose.
I'm not sure how generic is that issue, but docker-compose was working fine for the past weeks and all of a sudden stopped working with this CPU error.
By random trial and error I solved it by ticking "Use Docker Compose V2" in general preferences.
Interestingly, resetting factory settings seems to ignore the "Use Docker Compose V2" setting. If it's off, it leaves it off, if it's on, it leaves it on. But out of curiosity, I completely uninstalled Docker Desktop and reinstalled it again, and "Use Docker Compose V2" was off by default.
It seems that Compose V2 has been around for quite a while now, and it must have been on by default in the past because I've never had this problem until today. I'm not sure what caused that setting to be turned off somehow and why a fresh install today also has Docker Compose V2 off by default.