Skip to content

Commit

Permalink
Feat: support multi-platforms (#6)
Browse files Browse the repository at this point in the history
Signed-off-by: Jianbo Sun <jianbo.sjb@alibaba-inc.com>
  • Loading branch information
wonderflow committed Jun 4, 2022
1 parent 785411d commit 1072771
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Build the manager binary
FROM golang:1.16 as builder
# Build the manager binary
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.17-alpine as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -15,8 +16,10 @@ COPY cmd/ cmd/
COPY pkg/ pkg/
COPY core/ core/

ARG TARGETARCH

# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on \
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} GO111MODULE=on \
go build -o kube-webhook-certgen main.go


Expand Down

0 comments on commit 1072771

Please sign in to comment.