Skip to content

Commit 9628ab8

Browse files
Mateus Oliveiraoadp-maintainers
authored andcommitted
fix: ARM images (openshift#332)
* fix: ARM images Signed-off-by: Mateus Oliveira <[email protected]> * fixup! fix: ARM images Signed-off-by: Mateus Oliveira <[email protected]> --------- Signed-off-by: Mateus Oliveira <[email protected]>
1 parent c59e626 commit 9628ab8

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

Dockerfile-velero-restore-helper.ubi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
FROM quay.io/konveyor/builder:latest AS builder
1+
FROM quay.io/konveyor/builder:ubi9-latest AS builder
2+
ARG TARGETOS
3+
ARG TARGETARCH
4+
25
ENV GOPATH=$APP_ROOT
6+
37
COPY . $APP_ROOT/src/github.com/vmware-tanzu/velero
8+
49
WORKDIR $APP_ROOT/src/github.com/vmware-tanzu/velero
5-
RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/velero-restore-helper github.com/vmware-tanzu/velero/cmd/velero-restore-helper
610

7-
FROM registry.access.redhat.com/ubi8-minimal
11+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/velero-restore-helper github.com/vmware-tanzu/velero/cmd/velero-restore-helper
12+
13+
FROM registry.access.redhat.com/ubi9-minimal
814
RUN microdnf -y update && microdnf clean all
915

1016
COPY --from=builder /opt/app-root/src/velero-restore-helper velero-restore-helper

Dockerfile.ubi

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
1-
# TODO! Find a real ubi8 image for golang 1.16
21
FROM quay.io/konveyor/builder:ubi9-latest AS builder
2+
ARG TARGETOS
3+
ARG TARGETARCH
4+
35
ENV GOPATH=$APP_ROOT
6+
47
COPY . /go/src/github.com/vmware-tanzu/velero
8+
59
WORKDIR /go/src/github.com/vmware-tanzu/velero
6-
RUN CGO_ENABLED=0 GOOS=linux 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
7-
RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o /go/src/velero-helper github.com/vmware-tanzu/velero/cmd/velero-helper
10+
11+
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
12+
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
813

914
FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder
15+
ARG TARGETOS
16+
ARG TARGETARCH
17+
1018
ENV GOPATH=$APP_ROOT
19+
1120
RUN mkdir -p $APP_ROOT/src/github.com/restic \
12-
&& cd $APP_ROOT/src/github.com/restic \
13-
&& git clone https://github.com/konveyor/restic -b konveyor-dev
21+
&& cd $APP_ROOT/src/github.com/restic \
22+
&& git clone https://github.com/konveyor/restic -b konveyor-dev
23+
1424
WORKDIR $APP_ROOT/src/github.com/restic/restic
15-
RUN CGO_ENABLED=0 GOOS=linux go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic
25+
26+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -a -mod=mod -ldflags '-extldflags "-static"' -o $APP_ROOT/src/restic github.com/restic/restic/cmd/restic
1627

1728
FROM registry.access.redhat.com/ubi9-minimal
1829
RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf -y reinstall tzdata && microdnf clean all

0 commit comments

Comments
 (0)