Skip to content
This repository has been archived by the owner on Feb 27, 2018. It is now read-only.

Port Forwarding for Some Port Names Causes Boot2docker to Fail to Start #24

Closed
jonAtBrightedge opened this issue Jul 9, 2014 · 3 comments

Comments

@jonAtBrightedge
Copy link

When forwarding a port in virtualbox so that I can see a port on a container, if the name of the port forwarding rule comes before "ssh" alphabetically, boot2docker will fail to start. I created a rule for a redis server (:6379) and named it redis. When boot2docker tries to ssh into the vm it passes 6379 as the -p argument instead of :2022. If I modify the name of the rule to "zzz", the correct port is passed to the ssh command. The below is the console output

Defined a port forwarding rule with name of redis that mapped 0.0.0.0:6379 -> 6379 in the vm.

2014/07/08 16:31:29 executing: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 6379
-i C:\Users\jdonnelly.ssh\id_boot2docker docker@localhost
2014/07/08 16:31:30 exit status 255

I changed the port forwarding rule name from redis to zzzz here.

PS C:\Program Files\Boot2Docker for Windows> .\boot2docker.exe -v ssh
2014/07/08 16:32:57 executing: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe showvminfo boot2docker-vm --machineread
able
2014/07/08 16:32:57 executing: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -p 2022
-i C:\Users\jdonnelly.ssh\id_boot2docker docker@localhost
## .
## ## ## ==
## ## ## ## ===
/""""""""""""""""/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~
____
o */
\ \ /
*
_____/


| |__ ___ ___ | ||__ \ | | ___ ___| | ___ _ __
| '_ \ / _ \ / _ | | __) / _` |/ _ \ / __| |/ / _ \ '|
| |) | () | () | | / / (| | () | (| < / |
|_.
/ / _/ __|,|/ _||_|_|
boot2docker: 1.1.0
master : 086c429 - Fri Jul 4 01:08:20 UTC 2014
docker@boot2docker:~$ exit

@SvenDowideit
Copy link
Contributor

@jonAtBrightedge please stop setting up port forwards for your container ports. that was a hack that you should (mostly) not need anymore. Instead, the container port will already be available on the host only network address reported by boot2docker ip.

That said, thankyou for your analysis -

(edited in after) - oooooh, now I know where I have a bug - and I'll fix that for 1.1.1 as well. Thank you even more (end)

I may just set the ssh one to aaaaaa - its only there to allow boot2docker to bootstrap itself to knowing the host only IP address to use (as virtual box port forwarding is not reliable and has lead to a number of issues)

@SvenDowideit
Copy link
Contributor

@jonAtBrightedge I think the 1.1.1 boot2docker manage tool should have fixed this issue - thanks to your bug report.

@SvenDowideit
Copy link
Contributor

closing in hope :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants