docs: improve "Docker container names resolution" section (#12079)
Ilya Mashchenko committed
Feb 3, 2022 at 15:57 UTC
8875acec2882ea02b932957c3618ef53b7c0da94
1 file changed
+14
-1
packaging/docker/README.md
+14
-1
@@ -321,12 +321,25 @@ services:
321
322
#### Giving group access to the Docker socket (less safe)
323
324
-**Important Note**: You should seriously consider the necessity of activating this option, as it grants to the `netdata`
324
+> You should seriously consider the necessity of activating this option, as it grants to the `netdata`
325
user access to the privileged socket connection of docker service and therefore your whole machine.
326
327
If you want to have your container names resolved by Netdata, make the `netdata` user be part of the group that owns the
328
socket.
329
330
+```yaml
331
+version: '3'
332
+services:
333
+ netdata:
334
+ image: netdata/netdata
335
+ # ... rest of your config ...
336
+ volumes:
337
+ # ... other volumes ...
338
+ - /var/run/docker.sock:/var/run/docker.sock:ro
339
+ environment:
340
+ - PGID=[GROUP NUMBER]
341
+```
342
+
343
To achieve that just add environment variable `PGID=[GROUP NUMBER]` to the Netdata container, where `[GROUP NUMBER]` is
344
practically the group id of the group assigned to the docker socket, on your host.
345