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
With recent versions of machine, you can simply do (where default is the name of the machine):
docker-machine ssh default -L 27017:localhost:27017
This is a more temporary solution than the VM configuration change.
Use the following variation to only forward ports in a background process:
docker-machine ssh default -f -N -L 27017:localhost:27017