Search code examples
dockerdocker-machinedocker-toolbox

docker-machine osx port forwarding


How does port forwarding work with docker-machine?

I recently installed the docker toolkit and spun up a container. However I cannot reach it on my local mac as.

Is this Port forwarding in docker-machine? using VBoxManage the best way to access the running docker container using my OSX browser?


Solution

  • To add port forwards from the command line to a running boot2docker VM use the following command:

    VBoxManage controlvm boot2docker-vm natpf1 "default,tcp,127.0.0.1,1234,,1234"