Boot2Docker: Connect to container over LAN

前端 未结 2 894
甜味超标
甜味超标 2021-02-06 15:25

I\'m using Boot2Docker 1.3.0 on my Mac and I\'m pretty happy so far using it. But now I\'d like to connect to a http container (exposes port 8080) not from my local machine but

2条回答
  •  既然无缘
    2021-02-06 15:57

    You need to port forward from the OSX box to the virtual machine

    VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port8080,tcp,,8080,,8080";

    should do the trick

    or, you could use ssh based port forwarding:

    boot2docker ssh -L 8000:localhost:8000

    see https://github.com/boot2docker/boot2docker/blob/master/doc/WORKAROUNDS.md

提交回复
热议问题