diff --git a/Dockerfile b/Dockerfile index e453428e..1c27df70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,13 @@ # Build the operator FROM registry.access.redhat.com/ubi8/go-toolset AS builder WORKDIR /go/src/github.com/kubernetes-sigs/node-feature-discovery-operator -COPY . . + +# Fetch/cache dependencies +COPY go.mod go.sum ./ +RUN go mod download # do the actual build +COPY . . RUN make build # Create production image for running the operator