Skip to content

Commit d15e275

Browse files
kaovilaioadp-maintainers
authored andcommitted
ubi: BUILDPLATFORM to build stage to enable cross compile. (openshift#336)
Signed-off-by: Tiger Kaovilai <[email protected]>
1 parent 3a1ed36 commit d15e275

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Dockerfile-velero-restore-helper.ubi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM quay.io/konveyor/builder:ubi9-latest AS builder
1+
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS builder
2+
ARG BUILDPLATFORM
23
ARG TARGETOS
34
ARG TARGETARCH
45

Dockerfile.ubi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM quay.io/konveyor/builder:ubi9-latest AS builder
1+
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS builder
2+
ARG BUILDPLATFORM
23
ARG TARGETOS
34
ARG TARGETARCH
45

@@ -11,7 +12,8 @@ WORKDIR /go/src/github.com/vmware-tanzu/velero
1112
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
1213
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
1314

14-
FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder
15+
FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-latest AS restic-builder
16+
ARG BUILDPLATFORM
1517
ARG TARGETOS
1618
ARG TARGETARCH
1719

0 commit comments

Comments
 (0)