From 1e4af2125620a755e0c9c24431b30803903cbaf2 Mon Sep 17 00:00:00 2001 From: Wei Wei Date: Wed, 11 Oct 2017 17:18:30 +0800 Subject: [PATCH] add rslave for docker example, so node_exporter can receive host mount/unmount events (#660) --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index f5ced0e1..8493ae20 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,20 @@ If you need to run it on Docker, you can deploy this exporter using the image](https://quay.io/repository/prometheus/node-exporter) with the following options and bind-mounts: +for docker version >= 1.10 +```bash +docker run -d -p 9100:9100 \ + -v "/proc:/host/proc:ro" \ + -v "/sys:/host/sys:ro" \ + -v "/:/rootfs:ro,rslave" \ + --net="host" \ + quay.io/prometheus/node-exporter \ + --path.procfs /host/proc \ + --path.sysfs /host/sys \ + --collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)" +``` + +for docker version < 1.10 ```bash docker run -d -p 9100:9100 \ -v "/proc:/host/proc:ro" \