Skip to content

Commit

Permalink
Don't use builder from docker.io
Browse files Browse the repository at this point in the history
  • Loading branch information
sseago committed Jun 16, 2021
1 parent 92d0004 commit 1f9a6f4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
11 changes: 6 additions & 5 deletions Dockerfile-velero-restic-restore-helper.ubi
Original file line number Diff line number Diff line change
@@ -1,12 +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/go-toolset:1.14.7 AS builder
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-restic-restore-helper github.com/vmware-tanzu/velero/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
COPY --from=builder /opt/app-root/src/velero-restic-restore-helper velero-restic-restore-helper

USER nobody:nobody

Expand Down
29 changes: 15 additions & 14 deletions Dockerfile.ubi
Original file line number Diff line number Diff line change
@@ -1,20 +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.6.0-konveyor' -mod=mod ./cmd/velero
FROM registry.access.redhat.com/ubi8/go-toolset:1.14.7 AS builder
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" -X github.com/vmware-tanzu/velero/pkg/buildinfo.Version=v1.6.0-konveyor' -o $APP_ROOT/src/velero github.com/vmware-tanzu/velero/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"' -mod=mod ./cmd/restic
FROM registry.access.redhat.com/ubi8/go-toolset:1.14.7 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/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
RUN microdnf -y update && microdnf -y install nmap-ncat && microdnf clean all
COPY --from=builder /opt/app-root/src/velero velero
COPY --from=restic-builder /opt/app-root/src/restic /usr/bin/restic

USER nobody:nobody

Expand Down

0 comments on commit 1f9a6f4

Please sign in to comment.