Commit 4f5ee750 authored by Geoff Simmons's avatar Geoff Simmons

Build the controller image so that 'mod download is usually cached.

Download modules when go.mod or go.sum change, not whenever any
source file changed.
parent 80728f19
...@@ -10,11 +10,13 @@ RUN mkdir -p /go/src/code.uplex.de/uplex-varnish/k8s-ingress/.git ...@@ -10,11 +10,13 @@ RUN mkdir -p /go/src/code.uplex.de/uplex-varnish/k8s-ingress/.git
WORKDIR /go/src/code.uplex.de/uplex-varnish/k8s-ingress WORKDIR /go/src/code.uplex.de/uplex-varnish/k8s-ingress
COPY go.mod . COPY go.mod .
COPY go.sum . COPY go.sum .
RUN vgo mod download
COPY ./pkg/ /go/src/code.uplex.de/uplex-varnish/k8s-ingress/pkg/ COPY ./pkg/ /go/src/code.uplex.de/uplex-varnish/k8s-ingress/pkg/
COPY ./cmd/ /go/src/code.uplex.de/uplex-varnish/k8s-ingress/cmd/ COPY ./cmd/ /go/src/code.uplex.de/uplex-varnish/k8s-ingress/cmd/
COPY ./.git/ /go/src/code.uplex.de/uplex-varnish/k8s-ingress/.git/ COPY ./.git/ /go/src/code.uplex.de/uplex-varnish/k8s-ingress/.git/
RUN vgo mod download
RUN vgo generate ./cmd/... && vgo build ./pkg/... ./cmd/... && \ RUN vgo generate ./cmd/... && vgo build ./pkg/... ./cmd/... && \
CGO_ENABLED=0 GOOS=linux vgo build -o k8s-ingress cmd/*.go CGO_ENABLED=0 GOOS=linux vgo build -o k8s-ingress cmd/*.go
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment