How to build a Docker image for an Arm architecture on a Mac?
I’m trying to figure out how to use Docker’s new beta on my Mac to build an image for a different architecture. Specifically I’m trying to build for Raspberry Pi which uses an Arm processor.
One Solution collect form web for “How to build a Docker image for an Arm architecture on a Mac?”
You need to set the
GOARM environment variables before you build your application:
export GOOS=linux export GOARCH=arm export GOARM=6 go build -o bin/yourapp_arm_6
see: Go environment variables
Depending on your Raspberry Pi version you must set the
GOARM version to 5, 6 or 7.