Skip to content

Commit

Permalink
fix: make docker-multiarch failed with vendor errors (#1601)
Browse files Browse the repository at this point in the history
Signed-off-by: haoshi.ren <haoshi.ren@smartx.com>
Co-authored-by: haoshi.ren <haoshi.ren@smartx.com>
  • Loading branch information
MichaelRren and haoshi.ren authored May 8, 2024
1 parent 9959b03 commit 4c3b681
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile_multiarch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build the manager and daemon binaries
ARG BASE_IMAGE=alpine
ARG BASE_IMAGE_VERSION=3.17
FROM --platform=$BUILDPLATFORM golang:1.19-alpine3.17 as builder
ARG BASE_IMAGE_VERSION=3.19
FROM --platform=$BUILDPLATFORM golang:1.20.14-alpine3.19 as builder

WORKDIR /workspace
# Copy the Go Modules manifests
Expand All @@ -13,13 +13,12 @@ COPY main.go main.go
COPY apis/ apis/
COPY cmd/ cmd/
COPY pkg/ pkg/
COPY vendor/ vendor/

# Build
ARG TARGETOS
ARG TARGETARCH
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o manager main.go \
&& GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -a -o daemon ./cmd/daemon/main.go
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 GO111MODULE=on go build -a -o manager main.go \
&& GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 GO111MODULE=on go build -a -o daemon ./cmd/daemon/main.go


ARG BASE_IMAGE
Expand Down

0 comments on commit 4c3b681

Please sign in to comment.