ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
268 stars 34 forks source link

QA information about HASS/supervised #31

Closed LaggAt closed 2 years ago

LaggAt commented 3 years ago

Question: Does this integration work with the HASS or supervisord installers? Answer: Most likely not, because they don't expose the Docker UNIX/TCP socket. If you got it working, please let me know, then I can add it to the README

I can use it, not by docker.sock but by using TCP. Worked for me using https://gist.github.com/styblope/dc55e0ad2a9848f2cc3307d4819d819f Maybe you want to update the QA.

Well, I didn't use the provided RPi setup, but used Raspbian and did some config on my own. Maybe this makes a difference. Thanks for enabling docker controls in my home automation!

DrBlokmeister commented 3 years ago

Okay, maybe I'm an idiot, but it doesn't work for me. I followed the steps in your link, but when I try to connect to Docker, I get an error:

root@BlokmeisterNUC:~# docker -H tcp://127.0.0.1:2376 ps
Cannot connect to the Docker daemon at tcp://127.0.0.1:2376. Is the docker daemon running?
root@BlokmeisterNUC:~# docker -H tcp://192.168.1.252:2376 ps
Cannot connect to the Docker daemon at tcp://192.168.1.252:2376. Is the docker daemon running?
root@BlokmeisterNUC:~# docker -H tcp://0.0.0.0:2376 ps
Cannot connect to the Docker daemon at tcp://0.0.0.0:2376. Is the docker daemon running?

My override.conf file looks like this:

 [Service]
 ExecStart=
 ExecStart=/usr/bin/dockerd

However in the comments below, it also has a comment for someone having this as override.conf:

[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

Moreover, is it OK to have a daemon.json file that has this: {"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}, or should I use my own IP?

Edit: disregard that. I just noticed that I had entered port 2376 instead of 2375. Just confirmed that I am indeed an idiot!

LaggAt commented 2 years ago

So it's working for you?

DrBlokmeister commented 2 years ago

Jup. Been using it happily for about a year. Thanks! :)

LaggAt commented 2 years ago

oh sry, this just was shown in notifications :)

ualex73 commented 2 years ago

It is added to the README now, so I will close this one.