I am attempting to build a Docker image for my application to use within Integration tests.
The image can be built fine on my old 2017 Macbook but fails when trying on my new Macbook with the M1 chip.
The error I receive is:
unable to build image:
The command '/bin/sh -c make build' returned a non-zero code: 2
{"version": "TEST", "output": "Step 1/9 : FROM golang:1.15.3-alpine3.12 AS builder---> 9701aa6ab80a
Step 2/9 : RUN apk update && apk add gcc make git libc-dev ---> Using cache ---> 87ff8d250e2d
Step 3/9 : ADD ./ /src/ ---> Using cache ---> ef95bb030ff7
Step 4/9 : WORKDIR /src/ ---> Using cache\n ---> 3b982c9ab004
Step 5/9 : RUN make build ---> Running in f7596e65a80b\u001b[91m# github.com/qadre/huski.go\n/usr/local/go/pkg/tool/linux_arm64/link: running gcc failed: exit status 1
collect2: fatal error: cannot find 'ld'\ncompilation terminated.\n\n\u001b[0m\u001b[91
mmake: *** [Makefile:8: build] Error 2\n\u001b[0mRemoving intermediate container f7596e65a80b\n"}
My make build is
build: @go build -race -o huski-go -ldflags="-X 'main.Version=${VERSION}'"
When I run ld -v I get:
@(#)PROGRAM:ld PROJECT:ld64-609.8 BUILD 15:07:46 Dec 18 2020 configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em LTO support using: LLVM version 12.0.0, (clang-1200.0.32.29) (static support for 27, runtime is 27) TAPI support using: Apple TAPI version 12.0.0 (tapi-1200.0.23.5)
Has anyone encountered this with the new Macbooks?