diff --git a/Dockerfile b/Dockerfile index 64a4236..2909cfb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,12 @@ # # TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst -FROM golang:1.18-alpine3.16 as builder +FROM --platform=${BUILDPLATFORM} golang:1.18-alpine3.16 as builder + +ARG TARGETARCH +ENV GOARCH "${TARGETARCH}" +ENV GOOS linux + RUN apk add git openssh-client make curl # COPY only the go mod files for efficient caching diff --git a/Makefile b/Makefile index 1763fff..21324a0 100755 --- a/Makefile +++ b/Makefile @@ -11,8 +11,10 @@ clean: rm -rf bin .PHONY: linux_compile +linux_compile: export CGO_ENABLED ?= 0 +linux_compile: export GOOS ?= linux linux_compile: - GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts/flyte-copilot . + go build -o /artifacts/flyte-copilot . .PHONY: compile compile: