docker

Access the host computer from a docker container

Use host.docker.internal as the network address or hostname to access services running on the host computer.

For example to access a postgres server running on the host from within the docker container:

psql -h host.docker.internal -U postgres postgres

This doesn't work on Linux hosts