diff --git a/Dockerfile b/Dockerfile index 51124d27f7..986a6ae2f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # Build the manager binary -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 diff --git a/must-gather/Dockerfile b/must-gather/Dockerfile index 1feeb37543..5b29fce105 100644 --- a/must-gather/Dockerfile +++ b/must-gather/Dockerfile @@ -1,15 +1,18 @@ -FROM quay.io/konveyor/builder:ubi9-v1.20 AS konveyor-builder +FROM --platform=$BUILDPLATFORM quay.io/konveyor/builder:ubi9-v1.20 AS konveyor-builder +ARG BUILDPLATFORM +ARG TARGETOS +ARG TARGETARCH ARG RESTIC_BRANCH=konveyor-0.15.0 ARG VELERO_BRANCH=konveyor-dev WORKDIR /build RUN curl --location --output velero.tgz https://github.com/openshift/velero/archive/refs/heads/${VELERO_BRANCH}.tar.gz && \ tar -xzvf velero.tgz && cd velero-${VELERO_BRANCH} && \ VELERO_COMMIT=$(git ls-remote https://github.com/openshift/velero HEAD | awk '{printf $1}') && \ - CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version='"${VELERO_BRANCH}"' -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA='"${VELERO_COMMIT}" -o /velero github.com/vmware-tanzu/velero/cmd/velero && \ + 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='"${VELERO_BRANCH}"' -X github.com/vmware-tanzu/velero/pkg/buildinfo.GitSHA='"${VELERO_COMMIT}" -o /velero github.com/vmware-tanzu/velero/cmd/velero && \ cd .. && rm -rf velero.tgz velero-${VELERO_BRANCH} && \ curl --location --output restic.tgz https://github.com/openshift/restic/archive/refs/heads/${RESTIC_BRANCH}.tar.gz && \ tar -xzvf restic.tgz && cd restic-${RESTIC_BRANCH} && \ - CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o /restic github.com/restic/restic/cmd/restic && \ + CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o /restic github.com/restic/restic/cmd/restic && \ cd .. && rm -rf restic.tgz restic-${RESTIC_BRANCH} FROM registry.access.redhat.com/ubi9/go-toolset:1.20.10 AS gobuilder