I am having an issue compiling on my Mac using Docker. I made a .sh file (I can later do a pull request to get it on Git for others) but it is crashing on some of the packages. Error is pasted below.
I do not have an emulator (like Parallels) installed and I am trying to use the “Use Rosetta for x86/amd64 emulation” option in Docker.
Do I need to make a custom Docker config to get a different version compatible with Mac?
Thanks!
Error Feedback in Terminal:
#12 [upstream 7/42] RUN arduino-cli core install “Sparkfun:apollo3@2.2.1”
#12 0.414 Downloading packages…
#12 0.414 Error during install: Error downloading tool SparkFun:arm-none-eabi-gcc@8-2018-q4-major: no versions available for the current OS, try contacting
#12 ERROR: process “/bin/sh -c arduino-cli core install \“Sparkfun:apollo3@2.2.1\”” did not complete successfully: exit code: 1
------
> [upstream 7/42] RUN arduino-cli core install “Sparkfun:apollo3@2.2.1”:
0.414 Downloading packages…
0.414 Error during install: Error downloading tool SparkFun:arm-none-eabi-gcc@8-2018-q4-major: no versions available for the current OS, try contacting
------
Ok, my docker experience is fairly limited, but some googling makes me think it’s related to a toolchain error (it was meant for intel); I asked an AI what to do and it came up with a plausible plan:
The short answer is:
You don’t need a brand-new Docker config file, but you do need to force the whole build to run as linux/amd64 and make sure Rosetta is actually working.
The SparkFun core you are installing ships an Intel-only GCC toolchain, so the container must look like an x86-64 Linux machine from the very first step; otherwise the package index won’t even list a downloadable file for “your OS” and you get the exact message you pasted.
Below is the checklist that usually gets people unstuck (copy / paste the snippets into your project).
-
Enable Rosetta in Docker Desktop
Settings → General
Use Virtualization framework
Use Rosetta for x86/amd64 emulation on Apple Silicon
Apply & Restart.
-
Force the image to be amd64 everywhere
Put this at the top of your Dockerfile (or the first stage that does the install):
FROM --platform=linux/amd64 ubuntu:22.04 # or whatever base you use
and/or build from the command line with:
docker buildx build --platform linux/amd64 --load -t my-arduino-image .
If you use docker-compose add:
services:
upstream:
platform: linux/amd64 # <-- key line
build: .
- (Optional but speeds things up) Pin BuildKit to a single native-amd64 node
If you have collegues on Intel you can share the cache:
docker buildx create --name rosetta --platform linux/amd64 --use
docker buildx build --platform linux/amd64 …
- Verify you are really running x86-64
Inside the container:
uname -m # → x86_64
ps -ef | head # binaries should be prefixed with /rosetta/rosetta when Rosetta is active
- Re-run the Arduino-cli command
Now the package index will see “Linux x86_64” and SparkFun:arm-none-eabi-gcc@8-2018-q4-major will download instead of throwing “no versions available for the current OS”.
Typical pitfalls
- Forgetting
--platform on multi-stage builds – every FROM line needs it if you want the whole graph to stay amd64.
- Letting Docker pick an ARM base image because it was already cached;
--no-cache or docker system prune helps.
- Using the “smart” quotes
“ ” that macOS replaces; stick to straight " " in the shell script.
If you incorporate those changes your .sh file should work on Apple-Silicon Macs exactly the same way it does on Intel boxes, and you’ll be able to PR it without extra documentation beyond “requires Docker Desktop with Rosetta enabled on Apple Silicon”.
1 Like
Your suggestions worked! Thanks a lot TS_Russel.
Also, I used Arduino IDE 2 and could compile. The VEML7700 library didn’t worked but that feature was easy to disable.
1 Like