The following steps explain a workaround to connect from a container to a postgres server installed on the host system. This pattern can be applied to other (host) services as well.
- Install postgres
brew install postgres
brew services start postgres
(https://github.com/Homebrew/homebrew-services)
- Attach a unused IP to the local lo0 interface
sudo ifconfig lo0 alias 10.200.10.1/24