Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
FR: port mapping switch for windows #15741
feature request: port mapping for windows
Idea: Mapping of guest ports to host ports
Reason: Docker is not yet fully platform-independent for guest TCP/IP services
new switch for docker.exe:
and/or a new command for Dockerfiles:
The latter is (a bit dangerous, and) less important - if the former switch is available.
should be existent, but ignored on Linux systems - then writing one manual would be enough.
I am optimistic that this is possible. I have not looked into the details yet, but for sure, it has been solved already by some extra (VirtualBox) commands, which I simply suggest now to include into the docker.exe. It will have to do some magic manipulation of the Virtualbox-Ethernet-Adapters, to map the wanted guest machine ports to host machine ports.
Thanks for considering this.
Please read this important information about creating issues.
If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information.
This is an automated, informational response.
For more information about reporting issues, see https://github.com/docker/docker/blob/master/CONTRIBUTING.md#reporting-other-issues
BUG REPORT INFORMATION
Use the commands below to provide key information from your environment:
Provide additional environment details (AWS, VirtualBox, physical, etc.):
List the steps to reproduce the issue:
Describe the results you received:
Describe the results you expected:
Provide additional info you think is important:
----------END REPORT ---------
I found this information:
VBoxManage.exe knows about my "default" machine:
Before my changes:
My below VBoxManage command results in a "Rule(1)":
This is what I had to do:
now when I am running my server:
these two addresses result in exactly the same pages in my browser:
I chose 9999 only for demonstration purposes, of course, the production system should simply map it to the same port 8888.
(1) Find a way to change the port forwarding without powering down the VM. Note that in the "Oracle VM VirtualBoxManager" I can actually change port forwarding settings on a running machine!
(2) The above "VBoxManage modifyvm ..." should go into "docker run --guesttohost ..."
It looks like you want docker to modify the VM host's port forwarding rules?
You an accomplish this same thing with no added features by listening to the event stream and automatically forwarding ports as needed.
I'm going to close this because it's just not something that really fits in with docker's functionality and can be done externally to docker easily enough.
If you think I've misinterpreted your use-case, please ping here so we can discuss.
One more comment ...
I am seeing myself more as a (new enthusiastic) user
Sounds as if perhaps that is your way to go then.
What about you write such an easily done extension, to make