Netdata in a docker container ./edit-config not found

I have a docker-compose.yml that works very well, and I am using it on four hosts:

version: '3'
services:
  netdata:
    image: netdata/netdata
    container_name: netdata
    hostname: ${HOSTNAME}
    ports:
      - 19999:19999
    restart: unless-stopped
    cap_add:
      - SYS_PTRACE
    security_opt:
      - apparmor:unconfined
    environment:
      - PGID=${PGID}
      - TZ=${TZ}
      - DO_NOT_TRACK=1
    volumes:
      - ${APPDATA}:/etc/netdata
      - netdatalib:/var/lib/netdata
      - netdatacache:/var/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/run/docker.sock:/var/run/docker.sock:ro

volumes:
  netdatalib:
  netdatacache:

According to the netdata docker documentation it is possible to adjust the configuration of agent containers by attaching to the bash shell of the running container.

Here’s what happens:

$ docker exec -it netdata bash
bash-5.1# cd /etc/netdata
bash-5.1# ./edit-config netdata.conf
bash: ./edit-config: No such file or directory

Am I missing something?

This is a result of how Docker handles bind mounts for volumes (with ‘normal’ volumes, the volume is auto-populated with the contents of the directory in the container image on volume creation, but for bind mounts, it does not do this).

There’s a PR open at Provide better handling of config files in Docker containers. by Ferroin · Pull Request #12310 · netdata/netdata · GitHub that will fix this for newly created containers using bind mounts. It hopefully should be merged in the next few days tops (and definitely before the next stable release in two weeks or so).

1 Like

Thank you for this explanation. I’ll watch the PR and make sure I pull the refreshed docker image and test when it is merged.