forked from openshift/velero
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ubi
29 lines (24 loc) · 1.42 KB
/
Dockerfile.ubi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# TODO! Find a real ubi8 image for golang 1.16
FROM quay.io/konveyor/builder:ubi9-latest AS builder
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
FROM quay.io/konveyor/builder:ubi9-latest AS restic-builder
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
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
FROM registry.access.redhat.com/ubi9-minimal
RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf -y reinstall tzdata && microdnf clean all
COPY --from=builder /go/src/velero velero
COPY --from=builder /go/src/velero-helper velero-helper
COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic
RUN mkdir -p /home/velero
RUN chmod -R 777 /home/velero
USER 65534:65534
ENV HOME=/home/velero
ENTRYPOINT ["/velero"]