Docker: MacOSX Expose Container ports to host machine

前端 未结 3 502
误落风尘
误落风尘 2020-12-31 08:41

In my job I working with docker and the option --net=host working like a charm forwarding the docker container ports to the machine. This allows me to adding gr

3条回答
  •  长发绾君心
    2020-12-31 09:36

    Not sure if docker for mac can support bi-directional connection later https://forums.docker.com/t/will-docker-for-mac-support-bi-directional-connection-between-host-and-container-in-the-future/19871

    I have two solution:

    1. you can write a simple wrapper script and pass the port you want to expose to the script
    2. use vagrant to start a virtual machine with network under control.

提交回复
热议问题