PHP Docker image crashes on M1 Mac, works perfectly on Intel Mac

Hello Docker Community!

I’m coming up empty on diagnosing an issue driving me to drink. I was hopeful of getting some help debugging the problem.

I have a docker container built from the official PHP images here Docker

With the advent of new Apple Silicon Macs, I figured it’d be a cinch to use buildx to compile versions of this image - but the image isn’t behaving as expected. Seems to compile ok, but on the M1 Macs, it just ‘jams’.

I’m using docker compose to raise the image

version: "2"

    image: circlical/php74app-behat-multi:latest
      - ./docker/php.ini:/usr/local/etc/php/php.ini:delegated
      - ./docker/php-fpm.conf:/usr/local/etc/php-fpm.conf:delegated
      - ./docker/php-log/:/var/log/php/:delegated
      - ./build/behat/coverage/:/behat-coverage/:delegated
      - nfsmount:/code:cached
      - lemonade-testnet

    driver_opts: 1450
    driver: bridge

    driver: local
      type: nfs
      o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
      device: ":${PWD}"

The filesystem is using nfsd, and I can confirm that it seems to mount as expected (can access all files from within the PHP container).

On my Intel Mac, I docker compose up and interact with it as one normally would. I can docker container exec -it $(docker-compose ps -q php) /bin/bash to get into the container, and execute code from the command line with no issue.

On the Apple Silicon Mac, however, executing this same described process just hangs (dead) - even CTRL+C won’t work. I’m not getting any backtraces with gdb, and if I strace the process, the output always freezes at the same spot and never reaches an exit code (just hung, dead in the middle of a read operation).

I’ve tried manipulating the amount of memory, reducing to 1 CPU, and tried every permutation of Virtualization Framework and gRPC/VirtioFS, and it’s always the same result.

Can you recommend some help toward debugging the problem? Anyone seen this?


Affected machine is an Apple M1, 16 GB on Mac Ventura 13.2

Hi everybody,
I just want to confirm PHP issues on a M1 with Ventura. We have our PHP docker image that worked fine on the Mac’s docker on Monterey. One thing we needed to add was platform: linux/amd64 for the webservice because an architecture issue.
Last week i updated to Ventura and since then PHP CLI commands, for example, just hang / freeze without any output. I don’t know if anything else can be added to the docker-compose. The goal is it should run both on intel and M1 Macs.
When I stop the container, I get a Error response from daemon: remove foo_nfsmount-www: volume has active mounts since Ventura.
What I also noticed, but cannot see the difference yet: When I run the system on a DDEV container, the PHP CLI commands work.

Maybe someone knows how I can find out differences to a custom image and compare configurations?

Thanks in advance.

@merzilla Building on what I initially wrote - back then I was on Big Sur and everything was working file on Intel Mac. Since then, I’ve updated to Ventura, and the PHP container just hangs; even after having been rebuilt with buildx; just doesn’t work.

After exhausting all debugging for a solid week, I’ve resorted to using Virtualbox until Docker gets patched up.

I think I had a bit of a red herring originally. I thought that Apple Silicon was to blame, but it seems the OS may have been the culprit.