Skip to content

Commit

Permalink
oadp-1.4: Fixes segmentation fault Container cross compile on macOS (#…
Browse files Browse the repository at this point in the history
…1606)

* Fixes segmentation fault cross compile on macOS

```sh
9.676 internal/bytealg: /opt/app-root/src/go/pkg/tool/linux_amd64/asm: signal: segmentation fault (core dumped)
12.78 cloud.google.com/go/storage/internal: /opt/app-root/src/go/pkg/tool/linux_amd64/compile: signal: segmentation fault (core dumped)
```

similar to fix seen at https://github.com/replicatedhq/local-volume-provider/pull/66/files#diff-5b6228cfe643850b0b1c8d2b5d69430bb121272e145b651c2ff6a85c23895b4eR1
for replicatedhq/local-volume-provider#65 (comment)

Signed-off-by: Tiger Kaovilai <[email protected]>

* BUILDPLATFORM

Signed-off-by: Tiger Kaovilai <[email protected]>

---------

Signed-off-by: Tiger Kaovilai <[email protected]>
  • Loading branch information
kaovilai authored Dec 11, 2024
1 parent b6fe707 commit 1a98a14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
9 changes: 6 additions & 3 deletions must-gather/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 1a98a14

Please sign in to comment.