1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

add port forwarding notes for mac/boot2docker docs

Docker-DCO-1.1-Signed-off-by: Cameron Boehmer <cameron.boehmer@gmail.com> (github: cameronboehmer)
This commit is contained in:
Cameron Boehmer 2014-02-09 05:05:19 -08:00
parent 8228e50581
commit 49b928c0b0

View file

@ -116,6 +116,21 @@ client just like any other application.
# Git commit (server): c348c04 # Git commit (server): c348c04
# Go version (server): go1.2 # Go version (server): go1.2
Forwarding VM Port Range to Host
-------------------------------
If we take the port range that docker uses by default with the -P option
(49000-49900), and forward same range from host to vm, we'll be able to interact
with our containers as if they were running locally:
.. code-block:: bash
# vm must be powered off
for i in {4900..49900}; do
VBoxManage modifyvm "boot2docker-vm" --natpf1 "tcp-port$i,tcp,,$i,,$i";
VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port$i,udp,,$i,,$i";
done
SSH-ing The VM SSH-ing The VM
-------------- --------------