Netdata can now utilize GPUs in the native image since it's now based on Debian. This image is no longer needed. Examples using the netdata/netdata image below
docker run -d --name=netdata \
-p 19999:19999 \
-v <YOUR DOCKER CONFIGS>/netdata/config:/etc/netdata \
-v netdatalib:/var/lib/netdata \
-v netdatacache:/var/lib/cache/netdata \
-v /etc/passwd:/host/etc/passwd:ro \
-v /etc/group:/host/etc/group:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /etc/os-release:/host/etc/os-release:ro \
-e PGID=<HOST_DOCKER_PGID> \
-e DO_NOT_TRACK= \
-e NETDATA_CLAIM_TOKEN= # See https://learn.netdata.cloud/docs/agent/claim#connect-an-agent-running-in-docker \
-e NETDATA_CLAIM_URL=https://app.netdata.cloud \
-e NETDATA_CLAIM_ROOMS= # See https://learn.netdata.cloud/docs/agent/claim#connect-an-agent-running-in-docker \
--gpus all \
--restart unless-stopped \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
netdata/netdata:stable
version: '3.8'
services:
netdata:
image: netdata/netdata:stable
container_name: netdata
hostname: netdata.example.com
ports:
- 19999:19999
restart: unless-stopped
depends_on:
- proxy
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
environment:
- DOCKER_HOST=proxy:2375
- NETDATA_CLAIM_TOKEN= # See https://learn.netdata.cloud/docs/agent/claim#connect-an-agent-running-in-docker
- NETDATA_CLAIM_URL=https://app.netdata.cloud
- NETDATA_CLAIM_ROOMS= # See https://learn.netdata.cloud/docs/agent/claim#connect-an-agent-running-in-docker
volumes:
- <YOUR DOCKER CONFIGS>/netdata/config:/etc/netdata
- netdatalib:/var/lib/netdata
- netdatacache:/var/lib/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
- /var/log/journal:/var/log/journal:ro
- /run/systemd/private:/run/systemd/private:ro
- /mnt/media:/mnt/media:ro
labels:
- swag=enable
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
proxy:
container_name: proxy
image: tecnativa/docker-socket-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- CONTAINERS=1
volumes:
netdatalib:
netdatacache:
This is an automated build of netdata with glibc package for use with nvidia-container-toolkit. Also available in Unraid Community Applications.
Netdata with Nvidia GPU monitoring in a container. This image was created due to netdata/netdata using Alpine, a musl distribution, as a base. Nvidia drivers are only compatible with glibc distributions. This image uses netdata/netdata as a base and adds a GNU C library to run binaries linked against glibc. This image does not contain nvidia-smi
, but is compatible with nvidia-container-toolkit and the Unraid Nvidia Plugin.
docker run -d --name=netdata \
-p 19999:19999 \
-v <YOUR DOCKER CONFIGS>/netdata/config:/etc/netdata \
-v <YOUR DOCKER CONFIGS>/netdata/lib:/var/lib/netdata \
-v <YOUR DOCKER CONFIGS>/netdata/cache:/var/cache/netdata \
-v /etc/passwd:/host/etc/passwd:ro \
-v /etc/group:/host/etc/group:ro \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc:/host/proc:ro \
-v /sys:/host/sys:ro \
-v /etc/os-release:/host/etc/os-release:ro \
-e PGID=<HOST_DOCKER_PGID> \
-e DO_NOT_TRACK= \
-e NETDATA_CLAIM_TOKEN= # See https://learn.netdata.cloud/docs/agent/claim#connect-an-agent-running-in-docker \
-e NETDATA_CLAIM_URL=https://app.netdata.cloud \
-e NETDATA_CLAIM_ROOMS= # See https://learn.netdata.cloud/docs/agent/claim#connect-an-agent-running-in-docker \
--gpus all \
--restart unless-stopped \
--cap-add SYS_PTRACE \
--security-opt apparmor=unconfined \
d34dc3n73r/netdata-glibc
version: '3.8'
services:
netdata:
image: d34dc3n73r/netdata-glibc
container_name: netdata
hostname: example.com # set to fqdn of host
ports:
- 19999:19999
restart: unless-stopped
depends_on:
- proxy
cap_add:
- SYS_PTRACE
security_opt:
- apparmor:unconfined
environment:
- DOCKER_HOST=proxy:2375
- NETDATA_CLAIM_TOKEN= # See https://learn.netdata.cloud/docs/agent/claim#connect-an-agent-running-in-docker
- NETDATA_CLAIM_URL=https://app.netdata.cloud
- NETDATA_CLAIM_ROOMS= # See https://learn.netdata.cloud/docs/agent/claim#connect-an-agent-running-in-docker
volumes:
- <YOUR DOCKER CONFIGS>/netdata/config:/etc/netdata
- <YOUR DOCKER CONFIGS>/netdata/lib:/var/lib/netdata
- <YOUR DOCKER CONFIGS>/netdata/cache:/var/lib/cache/netdata
- /etc/passwd:/host/etc/passwd:ro
- /etc/group:/host/etc/group:ro
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /etc/os-release:/host/etc/os-release:ro
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
proxy:
container_name: proxy
image: tecnativa/docker-socket-proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- CONTAINERS=1
- d34dc3n73r/netdata-glibc:stable
- built from netdata/netdata:stable and updated with new netdata official releases
- d34dc3n73r/netdata-glibc:latest
- an automated nightly build using netdata/netdata:latest
- Nvidia container toolkit installed on the host system
- Nvidia drivers installed on the host system
- Use the host docker PGID environment variable. To get this value run
grep docker /etc/group | cut -d ':' -f 3
on the host system.
- Container name resolution no longer requires the host docker PGID and mounting docker.sock. Instead this is handled by HAProxy so that connections are restricted to read-only access. For more information check out the Netdata Docker Installation Page.
Netdata now has override support built into their docker images. See Configure Agent Containers for more information. Vi is the default editor, but I like nano so this image includes nano. Use it with ./edit-config --editor nano <config filename>
.
- Netdata collects anonymous statistics. If you wish to opt-out, set the envionrment varible
DO_NOT_TRACK=1
. - This image uses the default python.d.conf with
nvidia_smi: yes
uncommented. Use./edit-config
for futher customization.