pkg/node_exporter from sources

Signed-off-by: Marco Mariani <marco.mariani@alterway.fr>
This commit is contained in:
Marco Mariani 2017-11-17 14:00:12 +01:00
parent 41a4c2df10
commit 01d0a1835c
3 changed files with 23 additions and 4 deletions

View File

@ -1,7 +1,27 @@
FROM prom/node-exporter:v0.15.1@sha256:88c602650e861bb8045ac83421edecbd056fc58708d47554a0d1a10f19ed7556
FROM linuxkit/alpine:07f7d136e427dc68154cd5edbb2b9576f9ac5213 as build
RUN apk add --no-cache go git musl-dev make
ENV GOPATH=/go PATH=$PATH:/go/bin
ENV GITREPO=github.com/prometheus/node_exporter
ENV COMMIT=v0.15.1
RUN go get -d ${GITREPO} \
&& cd /go/src/${GITREPO} \
&& git checkout ${COMMIT} \
&& CGO_ENABLED=0 make build \
&& mv node_exporter /bin/
FROM scratch
ENTRYPOINT []
CMD []
WORKDIR /
COPY --from=build /bin/node_exporter /bin/node_exporter
ENTRYPOINT ["/bin/node_exporter", "--path.procfs", "/host/proc", \
"--path.sysfs", "/host/sys", \
"--collector.filesystem.ignored-mount-points", \
"^/(sys|proc|dev|host|etc)($|/)"]
LABEL org.mobyproject.config='{"pid": "host", "binds": ["/proc:/host/proc", "/sys:/host/sys", "/:/rootfs"], "capabilities": ["all"]}'

View File

@ -0,0 +1,2 @@
image: node_exporter
network: true

View File

@ -1,3 +0,0 @@
image: node_exporter
# Can't pull with content trust. Skip for now
# https://github.com/linuxkit/linuxkit/issues/2349