-
Notifications
You must be signed in to change notification settings - Fork 379
Add instructions for running Docker images on M1 #1336
Conversation
By specifying the `--platform=linux/amd64 ` flag, the image can run on M1 computers otherwise with the current instructions the images fail to run on M1 hardware.
Why would you want to compile the collator for linux when you want to run it on Mac? |
When I try to run the following on an M1 Mac: $ docker run --rm -it -w /shellhere/cumulus \
-v $(pwd):/shellhere/cumulus \
paritytech/ci-linux:production cargo build --release --locked -p polkadot-parachain
sudo chown -R $(id -u):$(id -g) target/ I get the following:
And I am unable to run the image. However, if I add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to hear it was that simple
Yeah, that sounds plausible. What I wanted to point out is that the binary in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the default platform for docker so no harm being explicit.
Any blockers here? Or can we merge this? |
Has someone done the steps and then checked that it works? I still don't see how a linux binary can be run on Mac os. |
AFAIU, Docker is running a linux container on my Mac. I would expect it to request by default a linux/amd64 image. Instead it detects the "host platform" which is in my case linux/arm64/v8 and in our case the requested image does not exist. That is why explicitly specifying Found this on the Docker site:
Maybe this is why it detects the host platform. |
@brunopgalvao have you repeated the steps that are written inside the README? And by that I mean also to execute the binary? |
Okay so I ran through the steps. You are right. The binary will not run on macOS. You can see in the video below. Feel free to close this. docker-m1.mov |
By specifying the
--platform=linux/amd64
flag, the image can run on M1 computers otherwise with the current instructions the images fail to run on M1 hardware.