Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to forward a range of ports to container #3898

Closed
bwateratmsft opened this issue Oct 23, 2020 · 6 comments
Closed

Ability to forward a range of ports to container #3898

bwateratmsft opened this issue Oct 23, 2020 · 6 comments
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality

Comments

@bwateratmsft
Copy link
Collaborator

Originally from @peredwardsson here: microsoft/vscode-docker#2433

Also related: #1386, especially this comment

Issue Type: Feature Request

I'm working with robotics using the ROS ecosystem. In it, you can create services that act as functions that can be called to by other parts of the system. The services are assigned a predetermined IP and a random available port somewhere above 30000. This makes developing in a container frustrating, since I have to manually forward the port of the day into the container. EXPOSE-ing the port in the Dockerfile doesn't help, nor does using "runArgs": ["--expose=30000-65535"] in the devcontainer.json.

I would like to be able to add such a range of ports to the forwardPorts field of devcontainer.json, such that I could use
"forwardPorts": [30000-65535]
or
"forwardPorts": [30000:] (for "30000 onward")
or maybe even
"forwardPorts": [*] (for "all ports")

To the best of my abilities, this doesn't seem doable at the moment. Happy to answer questions should they pop up.

VS Code version: Code 1.50.1 (d2e414d9e4239a252d1ab117bd7067f125afd80a, 2020-10-13T14:44:48.716Z)
OS version: Linux x64 5.4.0-51-generic snap

@chrmarti
Copy link
Contributor

@peredwardsson Would using the host's network be an option? (https://docs.docker.com/network/network-tutorial-host/)

@chrmarti chrmarti self-assigned this Oct 26, 2020
@chrmarti chrmarti added the feature-request Request for new features or functionality label Oct 26, 2020
@peredwardsson
Copy link

Yes, and it does solve the immediate problem, thanks.

@PavelSosin-320
Copy link

This is not a VSCode feature, this is ContainerNetworkingInterface feature with numerous dependencies. Now docker run -p and docker run --expose are supported. If it is not enough dependencies are from Linux Kernel to Google agreement to change Docker interface because Dcker is Kubernetes Container engine.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants
@chrmarti @peredwardsson @bwateratmsft @PavelSosin-320 and others