dotcloud/docker — pull request #3188 by keyvanfatehi (2013-12-12 03:55:29+00:00)
Title: Vagrantfile port forwarding made more flexible (w/ comments)

`Vagrantfile port forwarding usages documented. Added usage via envvar FORWARD_PORTS for custom port or list of comma-separated ports`

This relates to #857 and #856 and #2357 and any others regarding port forwarding via Vagrant

I got here after searching for how to expose 5601 (Kibana, as part of Docker image ehazlett/logstash) the recommended way under Mac/Vagrant/Docker and and noticing FORWARD_DOCKER_PORTS envvar in Vagrantfile.

My problem with that is rather than simply letting me selectively inform Vagrant which ports to forward, it's just a boolean switch to forward the range 49000..49900 which is not necessarily my use-case.

This PR allows for my use-case while preserving the existing dynamic port range boolean switch “FORWARD_DOCKER_PORTS”

Added usage:

`FORWARD_PORTS=8080,27017 vagrant [up|reload]`

These envvars can be used together, independently, or not at all and I tried to express how to use them in the comments within the Vagrantfile.

Thanks!