From 8c9bd56c95b8f29bf1be327fb220b0422a5e4428 Mon Sep 17 00:00:00 2001 From: Valentino Lauciani Date: Mon, 17 Feb 2025 16:13:59 +0100 Subject: [PATCH] Update README.md: use 'mode: host' in Docker Swarm configuration Signed-off-by: Valentino Lauciani --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 4a059c42..10cc9689 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,24 @@ services: - '/:/host:ro,rslave' ``` +For Docker compose for Docker Swarm, `network_mode` and `pid` are not supported. The `network_mode` option must be replaced with `mode: host` in the `ports` section. + +```yaml +--- +version: '3.8' + +services: + node_exporter: + image: quay.io/prometheus/node-exporter:latest + . . . + ports: + - target: 9100 + published: 9100 + protocol: tcp + mode: host + . . . +``` + On some systems, the `timex` collector requires an additional Docker flag, `--cap-add=SYS_TIME`, in order to access the required syscalls.