How does HASS.io in Docker under Ubuntu affect the Discovery component?

So I’m experiencing a few problems with HASS.io after migrating from RPi3 to Ubuntu in a Docker container.

  1. Ingress add-ons fail to load. I can use the port URL to access them outside of HA, but the panel links just return 502: Bad Gateway and the system log reports an inability to connect to the network that the docker container is running on.

  2. Discovery seems to fail, specifically for Google Home devices. After reading about it, it seems that discovery requires that the devices being discovered are on the same subnet as HASS.io? If that’s the case, and all of the google devices are on 192.168.1.0/24, and home assistant is on some weird 172.x.x.x network, how can I rely on discovery at all, or what should be done to make sure that each network can see the other?

You need to understand that even if you are using HassOS, it is the EXACT same as hassio on docker. That “weird” network is the internal Docker network. It will be on any install of hassio, on any platform, because that’s how Docker works.

Got it. Now, with that, does that mean that the network created for the Docker container can inherently access all of the networking resources of the Ubuntu box without needing to futz with the firewall, or do I need to explicitly work on routing and firewall issues to ensure that HASS.io has access to the resources?

My gut tells me no because I’m able to see the USB ports in HASS.io right off the bat, but I still don’t have a solution for the ingress errors I’m seeing and the 502 Bad Gateway problem that happens with ESPHome and NodeRED.

Thanks!

It runs the container as network_mode=host so it has access to the entire networking stack on the host. You don’t have to mess with anything.

This is probably NOT related to the fact that it’s running in Docker at all.

I suspected that. I’m coming from HASS.io on RPi3 in which Ingress was working correctly. Rather than simply copying and pasting my config, I elected to start from scratch so I could document every step.

Right after running Frenck’s script, HASS.io was up and running, but the system log did contain a huge block of errors that look like they’re related to hardware resources.

The log also reported a problem with Ingress. So far, it’s strange because Portainer and Visual Studio both work correctly, but ESPHome and NodeRED (while accessible via URL and port #) report bad gateway, with a system error indicating that the network destination (Docker 172.x.x.x) is unreachable.

Of course, if I ping that network, or run nmap on it, I get a reading, and the ports that both add-ons are attempting to use report to be open.

Sorta stumped, I guess.