Open ddzikon opened 1 year ago
@ddzikon thanks for opening the issue.
What is the Apple M1 architecture in a Docker image on macOS? Is it aarch64
?
What is the Apple M1 architecture in a Docker image on macOS? Is it
aarch64
?
Yes, it is aarch64
@ddzikon there is now an Alpine Linux Dockerfile. The Go version of Alpine Linux is fairly new and therefore it is installed from the package sources. As a result, building the image using the Alpine Linux image should work on aarch64
(ARM 64-bit).
To start the solution use: sechub-solution/01-start-single-docker-compose-alpine.sh.
Situation
Building Docker images with use of startup scripts on Apple Mac with M1 processor with following options in
.env
:BUILD_TYPE=build
BRANCH="develop"
causes build failure:
Wanted
It is possible to build Docker images on platforms with ARM processor architecture.
Solution
Probable cause is the version of GO language set in
.env
file, when running a build on MacOS with ARM architecture.Currently the version of GO is
GO="go1.19.linux-amd64.tar.gz"
.Building works when the version is changed to the one proper for ARM architecture:
GO="go1.19.5.linux-arm64.tar.gz"
A solution would be picking the GO version according to platform's architecture, i.e. with use of
apk --print-arch
- example in official Golang Dockerfile.