Use host PID namespace in docker example
* Use host PID namespace in docker example
See
* Update readme for readability
* Fix comments in readme
@@ -166,40 +166,16 @@ To see all available configuration flags:
## Using Docker
The node\_exporter is designed to monitor the host system. It's not recommended
to deploy it as Docker container because it requires access to the host system.
-If you need to run it on Docker, you can deploy this exporter using the
-[node-exporter Docker
-image](https://quay.io/repository/prometheus/node-exporter) with the following
-options and bind-mounts:
+Be aware that any non-root mount points you want to monitor will need bind-mounted
+into the container.
-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" \
+docker run -d \
--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)($|/)"
+ --pid="host" \
+ quay.io/prometheus/node-exporter
```
-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" \
- --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)($|/)"
-```
-
-Be aware though that the mountpoint label in various metrics will now have
-`/rootfs` as prefix.
-
## Using a third-party repository for RHEL/CentOS/Fedora
There is a [community-supplied COPR repository](https://copr.fedorainfracloud.org/coprs/ibotty/prometheus-exporters/). It closely follows upstream releases.
