2018-05-28 10:47:56 +00:00
|
|
|
# Build node feature discovery
|
|
|
|
FROM golang:1.8 as builder
|
2016-09-20 17:42:00 +00:00
|
|
|
|
2016-08-31 00:04:43 +00:00
|
|
|
ADD . /go/src/github.com/kubernetes-incubator/node-feature-discovery
|
2016-07-12 00:30:49 +00:00
|
|
|
|
2016-08-31 00:04:43 +00:00
|
|
|
WORKDIR /go/src/github.com/kubernetes-incubator/node-feature-discovery
|
2016-07-12 00:30:49 +00:00
|
|
|
|
2018-03-28 12:37:39 +00:00
|
|
|
ENV CMT_CAT_VERSION="v1.2.0"
|
2018-03-16 16:56:35 +00:00
|
|
|
|
2016-12-09 19:32:39 +00:00
|
|
|
ARG NFD_VERSION
|
2017-12-20 06:51:56 +00:00
|
|
|
|
|
|
|
RUN case $(dpkg --print-architecture) in \
|
|
|
|
arm64) \
|
|
|
|
echo "skip rdt on Arm64 platform" \
|
|
|
|
;; \
|
|
|
|
*) \
|
2018-04-11 10:40:43 +00:00
|
|
|
git clone --depth 1 -b $CMT_CAT_VERSION https://github.com/intel/intel-cmt-cat.git && \
|
2018-03-28 12:37:39 +00:00
|
|
|
make -C intel-cmt-cat/lib install && \
|
2018-05-28 10:47:56 +00:00
|
|
|
make -C rdt-discovery && \
|
|
|
|
make -C rdt-discovery install \
|
2017-12-20 06:51:56 +00:00
|
|
|
;; \
|
|
|
|
esac
|
|
|
|
|
2016-07-14 14:56:43 +00:00
|
|
|
RUN go get github.com/Masterminds/glide
|
2017-11-21 11:21:56 +00:00
|
|
|
RUN glide install --strip-vendor
|
2016-07-14 21:17:27 +00:00
|
|
|
RUN go install \
|
2016-12-09 19:32:39 +00:00
|
|
|
-ldflags "-s -w -X main.version=$NFD_VERSION" \
|
2016-08-31 00:04:43 +00:00
|
|
|
github.com/kubernetes-incubator/node-feature-discovery
|
2018-07-06 11:11:07 +00:00
|
|
|
RUN install -D -m644 node-feature-discovery.conf.example /etc/kubernetes/node-feature-discovery/node-feature-discovery.conf
|
2016-07-12 00:30:49 +00:00
|
|
|
|
2018-05-28 10:47:56 +00:00
|
|
|
RUN go test .
|
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
COPY --from=builder /usr/local/bin /usr/local/bin
|
|
|
|
COPY --from=builder /usr/local/lib /usr/local/lib
|
2018-07-06 11:11:07 +00:00
|
|
|
COPY --from=builder /etc/kubernetes/node-feature-discovery /etc/kubernetes/node-feature-discovery
|
2018-05-28 10:47:56 +00:00
|
|
|
RUN ldconfig
|
|
|
|
COPY --from=builder /go/bin/node-feature-discovery /usr/bin/node-feature-discovery
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/node-feature-discovery"]
|