Since boot2docker is deprecated I\'ve switched to docker-machine but I don\'t know how to open a port from docker-machine. In bo
Since I have hard time remembering how to do this I've created a small bash script called pf (which stands for "port forward") that allows you to do:
$ pf 8080
This will forward the docker port 8080 to host port 8080 in the background (append -f to make it run in the foreground). To use a different host port just do:
$ pf 8090:8080
which maps the host port 8090 to 8080.
To stop the port forwarding add -s:
$ pf 8090:8080 -s
(actually host port is enough as well: pf 8090 -s). There are other options available as well so checkout the github page.