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:
parent
67ddd87c41
commit
f4d55ce040
1 changed files with 7 additions and 1 deletions
|
@ -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 \
|
||||
|
|
Loading…
Add table
Reference in a new issue