Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Enable multiarch build and infer GOOS and GOARCH from environment (#57)
Browse files Browse the repository at this point in the history
* Enable multiarch build and infer GOOS and GOARCH from environment

Signed-off-by: Jeev B <[email protected]>

* fix copy pasta

Signed-off-by: Jeev B <[email protected]>

---------

Signed-off-by: Jeev B <[email protected]>
  • Loading branch information
jeevb committed Apr 12, 2023
1 parent 12f9ff5 commit a913fde
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a913fde

Please sign in to comment.