diff --git a/knowledge base/docker.md b/knowledge base/docker.md index bcf791a..f9e49c7 100644 --- a/knowledge base/docker.md +++ b/knowledge base/docker.md @@ -157,11 +157,16 @@ Those files come from the volume the docker container is using for its root, and 8eaaae8c0c72 hello-world "/hello" 45 seconds ago Exited (0) 10 seconds ago sleepy_brown ``` +- Docker's host networking feature is not supported on Mac, even though the `docker run` command doesn't complain about it.
+ This is due to the fact that the Docker daemon on Mac is running in a virtual machine, and not natively; hence, ports are exposed on the VM and not of the host running it.
+ One way around it is port forwarding to localhost (the `-p` or `-P` options). + ## Sources - [Arch Linux Wiki] - [Configuring DNS] - [Cheatsheet] +- [Getting around Docker's host network limitation on Mac] +1. [TL;DR](#tldr) 1. [Further readings](#further-readings) 1. [Sources](#sources) +## TL;DR + +```sh +docker run -d --name 'node-exporter' --rm \ + -p '9100:9100' --pid='host' -v '/:/host:ro,rslave' \ + 'quay.io/prometheus/node-exporter:latest' --path.rootfs='/host' +sudo apt install 'prometheus-node-exporter' +``` + ## Further readings - [Github] diff --git a/knowledge base/snmp exporter.md b/knowledge base/snmp exporter.md index c13f0a4..ec189e9 100644 --- a/knowledge base/snmp exporter.md +++ b/knowledge base/snmp exporter.md @@ -1,4 +1,4 @@ -# SNMP exporter +# Prometheus' SNMP exporter ## Table of contents