Skip to content

Commit f4c5202

Browse files
committed
Download and cache go modules in builder container
1 parent 49347f0 commit f4c5202

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

build/Dockerfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ FROM registry.svc.ci.openshift.org/openshift/release:golang-1.12 AS builder
22

33
# Allow specifying a GOPROXY cache during build to speed up dependency resolution
44
ARG GOPROXY
5-
ENV GOPROXY=$GOPROXY
65

7-
ENV OPERATOR_PATH=/go/src/github.com/openshift/managed-velero-operator
8-
COPY . ${OPERATOR_PATH}
6+
ENV OPERATOR_PATH=/go/src/github.com/openshift/managed-velero-operator \
7+
GO111MODULE=on \
8+
GOPROXY=$GOPROXY
9+
10+
RUN mkdir -p ${OPERATOR_PATH}
911
WORKDIR ${OPERATOR_PATH}
12+
COPY go.mod go.sum ./
13+
RUN go mod download
14+
COPY . .
1015
RUN make gobuild
1116

1217
####

0 commit comments

Comments
 (0)