How to connect (back) docker client to host?

This is a known limitation and not exactly clear when reading over docs. You have to find opaque references here and there:

  1. https://docs.docker.com/docker-for-mac/faqs/#how-do-i-connect-from-a-container-to-a-service-on-the-host
  2. Access host (not vm) from inside container

TL;DR you have to create an alias on your loop back to a non-routable IP of your choosing, say a 172.16.x.x that doesn’t conflict.

sudo ifconfig lo0 alias 172.16.1.1

Then you access your host inside containers with 172.16.1.1 for example.