From 01d0a1835c18bb6c5ea52de4536c811060fd1678 Mon Sep 17 00:00:00 2001 From: Marco Mariani Date: Fri, 17 Nov 2017 14:00:12 +0100 Subject: [PATCH] pkg/node_exporter from sources Signed-off-by: Marco Mariani --- pkg/node_exporter/Dockerfile | 22 +++++++++++++++++++++- pkg/node_exporter/build.yml | 2 ++ pkg/node_exporter/build.yml-skip | 3 --- 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 pkg/node_exporter/build.yml delete mode 100644 pkg/node_exporter/build.yml-skip diff --git a/pkg/node_exporter/Dockerfile b/pkg/node_exporter/Dockerfile index d1dfb6c4c..503ce13aa 100644 --- a/pkg/node_exporter/Dockerfile +++ b/pkg/node_exporter/Dockerfile @@ -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"]}' + diff --git a/pkg/node_exporter/build.yml b/pkg/node_exporter/build.yml new file mode 100644 index 000000000..883b46c31 --- /dev/null +++ b/pkg/node_exporter/build.yml @@ -0,0 +1,2 @@ +image: node_exporter +network: true diff --git a/pkg/node_exporter/build.yml-skip b/pkg/node_exporter/build.yml-skip deleted file mode 100644 index 0251be216..000000000 --- a/pkg/node_exporter/build.yml-skip +++ /dev/null @@ -1,3 +0,0 @@ -image: node_exporter -# Can't pull with content trust. Skip for now -# https://github.com/linuxkit/linuxkit/issues/2349