ualex73 / monitor_docker

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

Question : exposing docker.sock in HA supervisor install #52

Closed craigmcgowan closed 1 month ago

craigmcgowan commented 3 years ago

Hello, I use HA supervisor to run HA but like to use this integration. To get this integration to work, I need to go into portainer and edit the volumes of my homeassistant container to add in a bind to docker.sock.

This makes everything run beautifuly.... Until I upgrade HA from the supervisor. This obviously recreates HA using the latest image, but removes the binded volume I've previously added.

I know this is more a docker question, but how can I keep my binded volume, or readd it automatically, after upgrades?

What do other people do?

Thank you.

fspralja commented 3 years ago

Hi, same issue here, tried to dig into supervisor code to see how they create the ha container but didn't get far. Maybe this plugin could be reworked somehow to start in own docker image as a supervisor addon, have to take some more time for this, or wait for more help from others.

donpablos commented 3 years ago

@craigmcgowan can you share how you add a volume by portainer or show a result of command: docker inspect homeassistant?

craigmcgowan commented 3 years ago

@donpablos sure, take a look at https://community.home-assistant.io/t/exposing-docker-sock-for-monitor-docker/265565/10?u=craig_mcgowan and I've explained it there. Let me know if you get stuck.

ualex73 commented 3 years ago

@craigmcgowan sorry, I don't know to add it automatically during an upgrade either.

craigmcgowan commented 3 years ago

Thanks for the reply

craigmcgowan commented 3 years ago

Hi All

Good news, someone has told me how to achieve this over at https://community.home-assistant.io/t/exposing-docker-sock-for-monitor-docker/265565/30 using a proxy docker container and connecting to this via TCP instead. Hope this helps anyone else who had this problem.

ghost commented 3 years ago

If this is fixed or resolved, please close this issue.

niek1992 commented 2 years ago

I have 4 Docker hosts which i monitor using monitor_docker but liked my Supervised install to be monitored as well. Tried looking into the socket_proxy to allow monitor_docker to read the container(s) on the Supervised installation. I ended up doing what i do with all my hosts, is expose the Docker API over TCP. More specifically on the IP 127.0.0.1. This allowed me to configure monitor_docker to connect to the Docker API running in a Supervised installation.

ualex73 commented 1 month ago

The issue is resolved, so I will close it ;-)