I salvaged an old MacBook Pro mid-2012, re-imaged it to Catalina, installed HomeBrew, Docker Desktop, and finally WebThingsIO. It was an extended home education and integration learning task as I’m new to all things Apple.
So, basic WT 1.1 container seems to work ok and I can make incoming connections into the VM-hosted docker desktop WT container. Alas, it seems that docker desktop runs in a VM and also the containers it spawns too. It does not support the common docker argument: -net=host, to bridge the container to the hosts network. It only supports incoming port mapping using the -p 8080:8080 syntax for incoming ports. This means that an addon cannot TCP connect to a remote IP address, practically breaking WT functionality.
I really had high-hopes about using this laptop as a HA server. It supports always-on, auto boot to desktop, auto start wireguard, sshd and Team Viewer…
Q: does anybody have any experience with MacOS, Docker Desktop & Containers, specifically, network configuration to support outgoing TCP connections from within the container?
There is a special hostname running inside the container: host.docker.internal, that is assigned a random IP using a VM-only subnet. This allows the container to access a virtual IP that it responds to. Confusingly, on the host, this virtual subnet is not visible by ifconfig, netstat, etc.
Comments, or links to Docker Desktop VM Network documentation, appreciated…
Google has been no help so far!
Since a container can access the host using the internal VM IP exposed by host.docker.internal, I theorize a hack is possible after implementing a NAT process on this subnet. Since the subnet is hidden by the docker desktop VM I’m at a loss if this is even possible.