Skip to content

Commit

Permalink
ubi: BUILDPLATFORM to build stage to enable cross compile. (openshift…
Browse files Browse the repository at this point in the history
…#336)

Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai authored and sseago committed Dec 11, 2024
1 parent fb2df1e commit 847ce47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile-velero-restore-helper.ubi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM quay.io/konveyor/builder:ubi9-latest AS builder
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS builder
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

Expand Down
6 changes: 4 additions & 2 deletions Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM quay.io/konveyor/builder:ubi9-latest AS builder
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS builder
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

Expand All @@ -11,7 +12,8 @@ WORKDIR /go/src/github.com/vmware-tanzu/velero
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=konveyor-dev' -o /go/src/velero github.com/vmware-tanzu/velero/cmd/velero
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper

FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS restic-builder
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

Expand Down

0 comments on commit 847ce47

Please sign in to comment.