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

UDP exposed ports not launching correctly #284

Closed
GTB3NW opened this issue Jun 26, 2018 · 3 comments
Closed

UDP exposed ports not launching correctly #284

GTB3NW opened this issue Jun 26, 2018 · 3 comments
Assignees
Labels
Milestone

Comments

@GTB3NW
Copy link

GTB3NW commented Jun 26, 2018

For example in my config if I have:

        "ExposedPorts": {
            "20000/udp": {}
        },

The launched container is given the following flags:

$ docker run --rm -d -p 20000:20000 <redacted image>

It should be:

$ docker run --rm -d -p 20000:20000/udp <redacted image>

I think it's just a bug with vscode parsing the config and not knowing to correctly add /udp when it's a udp service.

If I'm doing something wrong myself please do let me know.

@StephenWeatherford StephenWeatherford added this to the 0.2.0 milestone Jul 25, 2018
@StephenWeatherford StephenWeatherford modified the milestones: 0.2.0, 0.1.0 Jul 25, 2018
@PrashanthCorp PrashanthCorp self-assigned this Aug 3, 2018
@PrashanthCorp
Copy link
Contributor

PrashanthCorp commented Aug 3, 2018

It doesn't seem to be an issue with vscode.
This line in the docker run file makes the in-variance assumption that the host and listener ports are always the same.

I have a fix for this. I haven't exhaustively tested this. I just want to understand all the other use cases of the -p flag:

  1. The default format (no overrides from config file) tends to be 300/tcp. Does this assumption hold well?
  2. It looks like the host port like 3000/tcp would be invalid. Is truncating this in all cases a reasonable course of action?

Will have a PR out soon.
It'd be great if you could review it and lmk if it fixes the edge cases you have in mind.

@GTB3NW
Copy link
Author

GTB3NW commented Aug 9, 2018

Hey @PrashanthCorp apologies for my delay in getting back to you, I've not been logged in on github for a little while.

Thank you for submitted the PR, great work!

  1. With no manual changes to the config file that should be the default format. I've tried to find reference material as to what docker expects to see but I can't find it I'm afraid. I presume if you manually edit that to omit it, docker will not accept the file. Docker build does however automatically add /tcp if no protocol is specified, that behavior is what leads me to believe omission is not allowed in that generated output.

  2. Not 100% with what you mean there sorry. Could you explain?

@PrashanthCorp
Copy link
Contributor

Regarding 2, I mean something like this:
docker run --rm -d -p 20000/udp:20000/udp <container id>
which leads to an error :
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Invalid hostPort: 20000/udp.

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants