Docker - OS X forward localhost 22 port to container 2022 port

隐身守侯 提交于 2019-11-29 12:20:29
VonC

now I want to connect between my localhost:2022 to the machine:2022

Then you need your boot2docker VM (created by docker-machine) to port-forward the port 2022 to your MacOS host.
See "docker nginx container not receiving request from outside, connection refused" as an example.

VBoxManage controlvm "default" natpf1 "tcp-port2022,tcp,,2022,,2022"
VBoxManage controlvm "default" natpf1 "udp-port2022,udp,,2022,,2022"

Note: this is not releated to ssh specifically, it is only related to the fact that you are using a VM as a Linux host, and you have mapped something to its port 2022.
That port will be visible from your actual MacOS localhost only if you port-forward it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!