Open thilgen opened 1 month ago
Thanks to the suggestion from @gilhoffer - I had half the answer right in front of me - that the x86
arch sort of works on M1-Arm
- with a small tweak.
The way to get this to work on my M1 Mac was to both build and execute the image specifying the linux/amd64
architecture - so that Docker and the Mac would use Rosetta to emulate the x86
behavior.
MAC> mkdir ~/Desktop/salto-docker-build-test
MAC> cd ~/Desktop/salto-docker-build-test
MAC> git clone git@github.com:salto-io/salto.git
MAC> cd salto
MAC> docker build -t salto-cli-x86-on-arm --platform linux/amd64 .
MAC> docker run -it --platform linux/amd64 salto-cli-x86-on-arm /bin/bash
MAC-DOCKER> mkdir ~/my-workspace
MAC-DOCKER> cd ~/my-workspace
MAC-DOCKER> node /app/packages/cli/dist/src/main.js init --env-name production
Initiated empty workspace
Use `salto account add <service-name>` to add accounts to the environment
MAC-DOCKER>
Is this worth adding a note to the Docker instructions in (https://github.com/salto-io/salto/blob/main/README.md) that M1 users can try this approach? Or would it be preferred to just not mention it?
FWIW - I do think it would be good to state somewhere on that page that only x86 is officially supported (that would have saved me some time trying to figure out what was going on here).
Overview
I am able to successfully build and execute Salto with Docker on an X86 system.
However, using the same steps and files on an ARM system (M1 Mac), the Docker image builds but fails to run.
I used the standard Salto Dockerfile - with
ENTRYPOINT
commented out - for each of these scenariosNote: I see the same behavior if I leave in
ENTRYPOINT
and do interactive operations from the host system; but I wanted to get as close to showing the issue as possible which meant executing things inside the image so that I could reduce the impact that the host may have contributed to the execution error.On a clean AWS EC2 instance (x86-64) - 🟩 SUCCESS 🟩
[Amazon Linux: al2023-ami-2023.5.20240708.0-kernel-6.1-x86_64]
On MacBook Pro 14.5 (M1 Pro / arm-64) - 🟥 FAILED 🟥
Experiment: Run salto-cli-x86 on the MacBook Pro (arm-64) - 🟧 MOSTLY SUCCESS 🟧
Experiment: Run salto-cli-arm on the AWS EC2 instance (x86-64) - 🟥 FAILED 🟥