Could it be possible to have an option to have access to the docker socket on a particular host (read-only if there is some security issues) ? (ie -v /var/run/docker.sock:/var/run/docker.sock:ro). It is needed for nginx-proxy.
Yes we make a special option for local add-ons and it need to be activate per addon for user are aware that he run a add-on that can affect negative to hole system.
To be able to detect containers events (start/stop), read the virtualhost environment variable if it is set on the container and reload nginx with the new configuration if needed.
The use case for the environment variable on home assistant container is to be able to proxyfy it with the nginx proxy container. Another option would be to have the proxy configuration for homeassistant in an option. Perhaps it could also be done for all the containers, which would solve the socket problem. It would not be an automatic proxy container anymore, but it the case of hass.io it is not such a problem
The nginx proxy container whose link I had given is an auto configured proxy. It watch for container events, look for some specific environment variable in the other containers and configure the proxy accordingly. But Iām thinking itās a bit overkill for Hass.io. Iam also thinking that the socket is used to discover exposed ports which is needed for the proxy configuration.
I agree that itās overkill for Hass.io, at least at this point. Weāre still early and trying to figure out the best approach on getting a sustainable ecosystem of add-ons bootstrapped. Our #1 focus is to keep it very simple for the end-user and to some extend to the developers.
I think we should stay on Initial idea of hass.io and work with our addon concept for handing stuff. That give Aware that we not brake stuff on user device
The socket is also used by the configuration generator to find container ip and expose port to set up the reverse proxy, which allow not to publicly expose those ports but only the proxy. For simplicity sake, Iām going to stay with publicly expose ports if socket access is not doable.
EDIT : Iāve done some tests and it seems that docker block networking between containers, even with publicly exposed ports. From the host I can wget the homeassitant index
wget http://X.X.X.X:8123 --2017-05-18 12:22:28-- http://X.X.X.X:8123/ Connecting to X.X.X.X:8123... connected. HTTP request sent, awaiting response... 200 OK Length: 4720 (4.6K) [text/html] Saving to: āindex.htmlā
If I try the same command from a container wget http://X.X.X.X:8123 Connecting to X.X.X.X:8123 (X.X.X.X:8123) wget: error getting response
As I was working on a nginx_proxy with multiple vhost support, I was thinking that external port configuration could be a nice improvement. It could be needed if multiple addons publish the same ports and you want to proxify them. I donāt have an immediate need for that, but it could become necessary if the number of addons available increase.
The ability to choose the āhostā network mode would be welcome.
Iām trying to build an add-on for homebridge (which rely on avahi/zeroconf and needs to be on the same network as the userās iPhone) and I donāt think Iāll find a workaround.
If itās already possible, please point me in the right direction (Iām pretty new to Docker).