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