2018-05-28 10:47:56 +00:00
|
|
|
# Build node feature discovery
|
2020-02-05 21:15:44 +00:00
|
|
|
FROM golang:1.13.5 as builder
|
2016-09-20 17:42:00 +00:00
|
|
|
|
2019-09-04 15:17:58 +00:00
|
|
|
# Get (cache) deps in a separate layer
|
|
|
|
COPY go.mod go.sum /go/node-feature-discovery/
|
2016-07-12 00:30:49 +00:00
|
|
|
|
2019-11-20 13:41:48 +00:00
|
|
|
WORKDIR /go/node-feature-discovery
|
2016-07-12 00:30:49 +00:00
|
|
|
|
2019-09-04 15:17:58 +00:00
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
# Do actual build
|
|
|
|
COPY . /go/node-feature-discovery
|
|
|
|
|
2016-12-09 19:32:39 +00:00
|
|
|
ARG NFD_VERSION
|
2020-05-20 16:55:54 +00:00
|
|
|
ARG HOSTMOUNT_PREFIX
|
2017-12-20 06:51:56 +00:00
|
|
|
|
2016-07-14 21:17:27 +00:00
|
|
|
RUN go install \
|
2020-05-20 16:55:54 +00:00
|
|
|
-ldflags "-s -w -X sigs.k8s.io/node-feature-discovery/pkg/version.version=$NFD_VERSION -X sigs.k8s.io/node-feature-discovery/source.pathPrefix=$HOSTMOUNT_PREFIX" \
|
2019-01-11 13:55:28 +00:00
|
|
|
./cmd/*
|
|
|
|
RUN install -D -m644 nfd-worker.conf.example /etc/kubernetes/node-feature-discovery/nfd-worker.conf
|
2016-07-12 00:30:49 +00:00
|
|
|
|
2019-01-23 08:15:47 +00:00
|
|
|
RUN make test
|
2018-05-28 10:47:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Create production image for running node feature discovery
|
2018-05-28 12:41:32 +00:00
|
|
|
FROM debian:stretch-slim
|
2018-05-28 10:47:56 +00:00
|
|
|
|
2019-02-05 19:35:51 +00:00
|
|
|
# Use more verbose logging of gRPC
|
|
|
|
ENV GRPC_GO_LOG_SEVERITY_LEVEL="INFO"
|
|
|
|
|
2018-07-06 11:11:07 +00:00
|
|
|
COPY --from=builder /etc/kubernetes/node-feature-discovery /etc/kubernetes/node-feature-discovery
|
2019-01-11 13:55:28 +00:00
|
|
|
COPY --from=builder /go/bin/nfd-* /usr/bin/
|