Skip to content
This repository was archived by the owner on Jan 1, 2021. It is now read-only.

boot2docker / Forward all dynamic assigned ports - #73

Closed
aheissenberger wants to merge 1 commit into
boot2docker:masterfrom
aheissenberger:feature/pull/forward-all-dynamic-ports
Closed

aheissenberger wants to merge 1 commit into
boot2docker:masterfrom
aheissenberger:feature/pull/forward-all-dynamic-ports

Conversation

@aheissenberger

Copy link
Copy Markdown
Contributor

@schickling

Copy link
Copy Markdown
Contributor

👍

@SvenDowideit

Copy link
Copy Markdown
Contributor

mmm, this is complicated for me - I have a docker running on my host, and then use boot2docker to test other things - so hardcoding a thousand ports doesn't feel right

@aheissenberger

Copy link
Copy Markdown
Contributor Author

the best solution would be a docker wraper which will handle this by parsing the docker command line options and will dynamical set the ports to be forwarded - a similar solution will be needed for shared folders

@moul

moul commented Jan 24, 2014

Copy link
Copy Markdown
Contributor

Look at #93

It add an host only interface, so you have a dedicated ip for the boot2docker and won't have to setup any nat rules nor wrap anything

It stays simple and compatible with current solution

@aheissenberger

Copy link
Copy Markdown
Contributor Author

I have looked at your code and have also played with this solution but my understanding of this project was to expose as less as possible from the embedded system.

My current solution #104 does all the port forward mapping automaticly :-)

Using NFS I have to use the second host only interface too but I hope this gets solved with the 9fs files system.

@quick1024

Copy link
Copy Markdown

I would love to see #93 happen. The project may want to keep it minimal, but a big part of the docker effort is to allow auto assigned ports like: 0.0.0.0:49157->11211/tcp, 0.0.0.0:49158->22/tcp, 0.0.0.0:49159->3306/tcp, 0.0.0.0:49160->80/tcp. Sure would be nice to have @moul's work implemented so i could just go to secondary interface ip:auto port after a docker run.

#104 moves things away from native os-x support, not towards it. If you're going to run commands inside the VM, might as well just use a vagrant :-/

@deinspanjer

Copy link
Copy Markdown

So is there still further development work to be done here or is it just pending merge?
The user guide for OSX on the Docker site suggests the following script to set up dynamic port forwarding:
for i in {49000..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

I created a script called boot2docker-fwd that lets you create specific custom forwards or the brute force method described above:
https://gist.github.com/deinspanjer/9215467

@aheissenberger

Copy link
Copy Markdown
Contributor Author

@deinspanjer this project will not provide this feature

@schickling

Copy link
Copy Markdown
Contributor

@deinspanjer please check out the boot2docker-cli repo

@deinspanjer

Copy link
Copy Markdown

Okay, I asked because the feedback was mostly positive and the PR was still open. If it won't be incorporated, but the PR just hasn't been closed yet, that is fine.

@schickling

Copy link
Copy Markdown
Contributor

Don't get @aheissenberger wrong. As far as I know this feature request is still on the table but will be solved within the https://github.com/boot2docker/boot2docker-cli repo.

Is that correct @steeve?

@steeve

steeve commented Feb 26, 2014

Copy link
Copy Markdown
Contributor

Spot on @schickling.
@deinspanjer We're leaving the PR open until we have a better solution implemented. This solution is via host only networking and /etc/hosts.
But since we shifted development from sh to Go (for a lot of reasons), we're still focusing on having feature parity first, and getting the binary out there. Once it's released, we will add host only which will solve this problem (and allow for mounting volumes).

@SvenDowideit

Copy link
Copy Markdown
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants