Go can cross compile. qemu not needed

This commit is contained in:
Jean-Marc ANDRE 2020-12-13 20:51:36 +01:00
parent aa511e0343
commit a9f29e851b

View File

@ -1,5 +1,5 @@
# Build the manager binary
FROM arm32v7/golang:alpine as builder
FROM golang:alpine as builder
WORKDIR /workspace
# Copy the Go Modules manifests
@ -16,7 +16,7 @@ COPY pkg/ pkg/
COPY controllers/ controllers/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm GO111MODULE=on go build -a -o manager main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 GO111MODULE=on go build -a -o manager main.go
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details