问题
When I try to run filebeat with autodiscover I get the following error:
Exiting: error in autodiscover provider settings: 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.22/containers/json?limit=0: dial unix /var/run/docker.sock: connect: permission denied
I exposed the daemon on tcp://localhost:2375 from docker settings.
I checked that my user is member of "docker-users" group.
docker-compose.yml:
filebeat:
image: store/elastic/filebeat:7.3.0
volumes:
- ./config/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/lib/docker/containers/:/var/lib/docker/containers/:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
回答1:
Adding user: root
to docker-compose.yml fixes socket access:
filebeat:
image: store/elastic/filebeat:7.3.0
volumes:
- ./config/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/lib/docker/containers/:/var/lib/docker/containers/:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
user: root
来源:https://stackoverflow.com/questions/57724705/windows-docker-permission-denied-var-run-docker-sock