Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make images fails to build on Apple silicon #47

Open
ericsmalling opened this issue Apr 12, 2022 · 5 comments
Open

make images fails to build on Apple silicon #47

ericsmalling opened this issue Apr 12, 2022 · 5 comments
Assignees

Comments

@ericsmalling
Copy link

Seeing the following error on M1 based MacBook Pro where same commit works fine on an Intel based machine.

> make images
container image: kuard-build
  Building container image
[+] Building 0.0s (9/9) FINISHED                                                                                                                                            
 => [internal] load build definition from Dockerfile.build                                                                                                             0.0s
 => => transferring dockerfile: 1.34kB                                                                                                                                 0.0s
 => [internal] load .dockerignore                                                                                                                                      0.0s
 => => transferring context: 34B                                                                                                                                       0.0s
 => [internal] load metadata for docker.io/library/golang:1.12-alpine                                                                                                  0.3s
 => [1/6] FROM docker.io/library/golang:1.12-alpine@sha256:3f8e3ad3e7c128d29ac3004ac8314967c5ddbfa5bfa7caa59b0de493fc01686a                                            0.0s
 => CACHED [2/6] WORKDIR /data                                                                                                                                         0.0s
 => CACHED [3/6] RUN for ARCH in amd64 arm arm64 ppc64le; do       ln -s -f "/data/std/${ARCH}" "/usr/local/go/pkg/linux_${ARCH}_static" ;     done                    0.0s
 => CACHED [4/6] RUN apk update && apk upgrade && apk add --no-cache git nodejs bash npm                                                                               0.0s
 => CACHED [5/6] RUN GOPATH=/tmp GOBIN=/usr/local/bin go get -u github.com/jteeuwen/go-bindata/...                                                                     0.0s
 => ERROR [6/6] RUN GOPATH=/tmp GOBIN=/usr/local/bin go get github.com/tools/godep                                                                                     1.3s
------
 > [6/6] RUN GOPATH=/tmp GOBIN=/usr/local/bin go get github.com/tools/godep:
#9 1.324 # github.com/tools/godep
#9 1.324 /usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exec: "gcc": executable file not found in $PATH
#9 1.324 
------
executor failed running [/bin/sh -c GOPATH=/tmp GOBIN=/usr/local/bin go get github.com/tools/godep]: exit code: 2
make: *** [.kuard-build-image] Error 1
@ericsmalling
Copy link
Author

Probably an alpine base image issue given that it's failing in the Dockerfile build

@leandregagnonlewis
Copy link

leandregagnonlewis commented Sep 28, 2022

Try building with --platform linux/amd64 . This worked for me.

You will also need this flag to deploy the container.

@ericsmalling
Copy link
Author

ericsmalling commented Sep 28, 2022

Right, but the Makefile should work cross-platform. Even when running as ARCH=arm64 make images it fails with:

ARCH=arm64 make images                                                                                                                      ﳑ
generating Dockerfile .kuard-arm64-blue-dockerfile from Dockerfile.kuard
container image: kuard-build
  Building container image
[+] Building 0.0s (9/9) FINISHED
 => [internal] load build definition from Dockerfile.build                                                                                             0.0s
 => => transferring dockerfile: 43B                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                      0.0s
 => => transferring context: 34B                                                                                                                       0.0s
 => [internal] load metadata for docker.io/library/golang:1.12-alpine                                                                                  0.3s
 => [1/6] FROM docker.io/library/golang:1.12-alpine@sha256:3f8e3ad3e7c128d29ac3004ac8314967c5ddbfa5bfa7caa59b0de493fc01686a                            0.0s
 => CACHED [2/6] WORKDIR /data                                                                                                                         0.0s
 => CACHED [3/6] RUN for ARCH in amd64 arm arm64 ppc64le; do       ln -s -f "/data/std/${ARCH}" "/usr/local/go/pkg/linux_${ARCH}_static" ;     done    0.0s
 => CACHED [4/6] RUN apk update && apk upgrade && apk add --no-cache git nodejs bash npm                                                               0.0s
 => CACHED [5/6] RUN GOPATH=/tmp GOBIN=/usr/local/bin go get -u github.com/jteeuwen/go-bindata/...                                                     0.0s
 => ERROR [6/6] RUN GOPATH=/tmp GOBIN=/usr/local/bin go get github.com/tools/godep

@jbeda
Copy link
Member

jbeda commented Sep 29, 2022

Thanks all -- I'll try and find time to look at this this week. Might do some other cleanup in the repo.

@jbeda jbeda self-assigned this Sep 29, 2022
@carlosmsanchezm
Copy link

run:

docker build -t kuard-amd64:blue . --platform linux/amd64

worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants