On Mac and Windows it is possible to use docker.for.mac.host.internal
(replaces docker.for.mac.localhost
) and docker.for.win.host.int
For linux systems, you can – starting from major version 20.04
of the docker engine – now also communicate with the host via host.docker.internal
. This won't work automatically, but you need to provide the following run flag:
--add-host=host.docker.internal:host-gateway
See the answer here: https://stackoverflow.com/a/61424570/3757139