From 00c1eb6735b7b436dbe1ec1c73b0c35ad1430533 Mon Sep 17 00:00:00 2001 From: Dylan Murray Date: Mon, 29 Jun 2020 13:49:38 -0400 Subject: [PATCH] Add UBI Dockerfiles for Konveyor --- Dockerfile-velero-restic-restore-helper.ubi | 13 +++++++++++++ Dockerfile.ubi | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 Dockerfile-velero-restic-restore-helper.ubi create mode 100644 Dockerfile.ubi diff --git a/Dockerfile-velero-restic-restore-helper.ubi b/Dockerfile-velero-restic-restore-helper.ubi new file mode 100644 index 0000000000..f713e342ec --- /dev/null +++ b/Dockerfile-velero-restic-restore-helper.ubi @@ -0,0 +1,13 @@ +FROM openshift/origin-release:golang-1.14 AS builder +COPY . /go/src/github.com/vmware-tanzu/velero +RUN cd /go/src/github.com/vmware-tanzu/velero \ +&& CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -mod=mod ./cmd/velero-restic-restore-helper + +FROM registry.access.redhat.com/ubi8-minimal +RUN microdnf -y update && microdnf clean all + +COPY --from=builder /go/src/github.com/vmware-tanzu/velero/velero-restic-restore-helper /velero-restic-restore-helper + +USER nobody:nobody + +ENTRYPOINT [ "/velero-restic-restore-helper" ] diff --git a/Dockerfile.ubi b/Dockerfile.ubi new file mode 100644 index 0000000000..c1ff616fc0 --- /dev/null +++ b/Dockerfile.ubi @@ -0,0 +1,21 @@ +FROM openshift/origin-release:golang-1.14 AS builder +COPY . /go/src/github.com/vmware-tanzu/velero +RUN cd /go/src/github.com/vmware-tanzu/velero \ +&& CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=v1.3.0-konveyor' -mod=mod ./cmd/velero + +RUN mkdir /go/src/github.com/restic \ +&& cd /go/src/github.com/restic \ +&& git clone https://github.com/konveyor/restic -b konveyor-dev \ +&& cd /go/src/github.com/restic/restic \ +&& CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' ./cmd/restic + +FROM registry.access.redhat.com/ubi8-minimal +RUN microdnf -y install nmap-ncat && microdnf clean all +RUN microdnf -y update && microdnf clean all + +COPY --from=builder /go/src/github.com/vmware-tanzu/velero/velero velero +COPY --from=builder /go/src/github.com/restic/restic/restic /usr/bin/restic + +USER nobody:nobody + +ENTRYPOINT ["/velero"]