What is linux equivalent of “host.docker.internal”

前端 未结 9 1139
面向向阳花
面向向阳花 2020-12-02 09:37

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

9条回答
  •  有刺的猬
    2020-12-02 10:28

    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

提交回复
热议问题