Skip to content

Commit

Permalink
fix: ARM images (#332)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
mateusoliveira43 authored and shubham-pampattiwar committed Aug 22, 2024
1 parent eda6016 commit 9856cba
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
12 changes: 9 additions & 3 deletions Dockerfile-velero-restore-helper.ubi
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
FROM quay.io/konveyor/builder:latest AS builder
FROM quay.io/konveyor/builder:ubi9-latest AS builder
ARG TARGETOS
ARG TARGETARCH

ENV GOPATH=$APP_ROOT

COPY . $APP_ROOT/src/github.com/vmware-tanzu/velero

WORKDIR $APP_ROOT/src/github.com/vmware-tanzu/velero
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

FROM registry.access.redhat.com/ubi8-minimal
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

FROM registry.access.redhat.com/ubi9-minimal
RUN microdnf -y update && microdnf clean all

COPY --from=builder /opt/app-root/src/velero-restore-helper velero-restore-helper
Expand Down
23 changes: 17 additions & 6 deletions Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
# TODO! Find a real ubi8 image for golang 1.16
FROM quay.io/konveyor/builder:ubi9-latest AS builder
ARG TARGETOS
ARG TARGETARCH

ENV GOPATH=$APP_ROOT

COPY . /go/src/github.com/vmware-tanzu/velero

WORKDIR /go/src/github.com/vmware-tanzu/velero
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
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

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
ARG TARGETOS
ARG TARGETARCH

ENV GOPATH=$APP_ROOT

RUN mkdir -p $APP_ROOT/src/github.com/restic \
&& cd $APP_ROOT/src/github.com/restic \
&& git clone https://github.com/konveyor/restic -b konveyor-dev
&& cd $APP_ROOT/src/github.com/restic \
&& git clone https://github.com/konveyor/restic -b konveyor-dev

WORKDIR $APP_ROOT/src/github.com/restic/restic
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

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

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

0 comments on commit 9856cba

Please sign in to comment.