1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-05 08:17:04 +00:00

Dockerfile: store build deps in a separate layer

Speeds up local builds considerably as the deps are cached (instead of
downloading them all on every build) - as long as go.mod and go.sum are
not changed.
This commit is contained in:
Markus Lehtonen 2019-09-04 18:17:58 +03:00
parent 67ddd87c41
commit f4d55ce040

View file

@ -1,10 +1,16 @@
# Build node feature discovery
FROM golang:1.12 as builder
ADD . /go/node-feature-discovery
# Get (cache) deps in a separate layer
COPY go.mod go.sum /go/node-feature-discovery/
WORKDIR /go/node-feature-discovery
RUN go mod download
# Do actual build
COPY . /go/node-feature-discovery
ARG NFD_VERSION
RUN go install \