D34DC3N73R / netdata-glibc

netdata with glibc package for use with nvidia-docker2
GNU General Public License v3.0
21 stars 4 forks source link
docker netdata nvidia-container-toolkit nvidia-docker

⚠️ DEPRECATED via Netdata v1.43.0 ⚠️

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 & nvidia-container-toolkit

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

Docker Compose

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:

netdata-glibc

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.

nvidia-smi_netdata

Docker & nvidia-container-toolkit

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

Docker Compose

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

Available Tags

Prerequisites

Container Name Resolution

docker run

Override Directory

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>.

Notes