Accessing host machine as localhost from a Docker container that's also inside a boot2docker vm

前端 未结 3 2144
清歌不尽
清歌不尽 2020-12-02 08:43

Suppose I have a server running on port 8000 on OSX. How can my Docker container access it via localhost:8000? I can\'t change the hostname too as the app in th

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-02 09:16

    Instead of running with --net="host", try --add-host="localhost:192.168.59.3", which is the boot2docker host IP.

提交回复
热议问题