influxdata / sandbox

A sandbox for the full TICK stack
MIT License
486 stars 220 forks source link

Got permission denied while trying to connect to the Docker daemon socket #79

Open muskiii opened 2 years ago

muskiii commented 2 years ago

while running the Sanbox up facing an issue with telegraf saying:

23T16:59:05Z E! [inputs.docker] Error in plugin: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.21/info": dial unix /var/run/docker.sock: connect: permission denied

2022-01-23T16:59:05Z E! [inputs.docker] Error in plugin: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.21/containers/json?filters=%7B%22status%22%3A%5B%22running%22%5D%7D&limit=0": dial unix /var/run/docker.sock: connect: permission denied

i think it has something to do with https://www.influxdata.com/blog/docker-run-telegraf-as-non-root/

AirDRoN-lab commented 2 years ago

while running the Sanbox up facing an issue with telegraf saying:

Hello, try add this to docker-compose.yml:

telegraf:
      user: telegraf:<your_host_docker_gid>

For my case your_host_docker_gid = 998. You can check it execute stat -c '%g' /var/run/docker.sock in telegraf container.