cruizba / ubuntu-dind

A docker image based in ubuntu to run docker containers inside docker containers
Apache License 2.0
173 stars 78 forks source link

Can't run hello-world container if --platform=linux/amd64 is used on Mac #31

Open OlegLoewen opened 3 weeks ago

OlegLoewen commented 3 weeks ago

Hello,

✅ Following approach works: docker run -it --privileged cruizba/ubuntu-dind docker run hello-world

❌ But the following approach doesn't: docker run -it --platform=linux/amd64 --privileged cruizba/ubuntu-dind docker run hello-world

Error Message:

root@3bae54276060:/# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c1ec31eb5944: Pull complete
Digest: sha256:53cc4d415d839c98be39331c948609b659ed725170ad2ca8eb36951288f81b75
Status: Downloaded newer image for hello-world:latest
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: can't copy bootstrap data to pipe: write init-p: broken pipe: unknown.

I'm working on a Mac with M3 chip.

cruizba commented 2 weeks ago

I can't test your sceneario unfortunately, I don't have a Mac :(

I think the primary issue seems to be the multiple layers of virtualization. The --privileged option cannot be used with --platform=linux/amd64 because the container is actually run using Rosetta.