-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Publish does not work after upgrade #6806
Comments
Is that actually legal? Huh. Didn't think it was. Should be a quick fix, let me grab this. |
#6808 to fix |
Thanks! The idea is to pick a random port, where we are tunneling in those services:
This for compatibility with both virtualbox (host-only network) and docker desktop VM Otherwise one might as well have used the "front entrance" and used the CNI IP... |
Reworked to choose a random port, thanks for pointing that out. |
@mheon Documentation should be updated to reflect this change. There's currently nothing about randomizing port for this operation. There's also no mention, if you can specify combination of single container port and range of host ports. In this case, host port should be randomized from given range (if you wan't to follow docker's implementation) |
I'll do the second bit in a separate PR. |
I didn't believe that this was actually legal, but it looks like it is. And, unlike our previous understanding (host port being empty means just use container port), empty host port actually carries the same meaning as `--expose` + `--publish-all` (that is, assign a random host port to the given container port). This requires a significant rework of our port handling code to handle this new case. I don't foresee this being commonly used, so I optimized having a fixed port number as fast path, which this random assignment code running after the main port handling code only if necessary. Fixes containers#6806 Signed-off-by: Matthew Heon <[email protected]>
I didn't believe that this was actually legal, but it looks like it is. And, unlike our previous understanding (host port being empty means just use container port), empty host port actually carries the same meaning as `--expose` + `--publish-all` (that is, assign a random host port to the given container port). This requires a significant rework of our port handling code to handle this new case. I don't foresee this being commonly used, so I optimized having a fixed port number as fast path, which this random assignment code running after the main port handling code only if necessary. Fixes containers#6806 Signed-off-by: Matthew Heon <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
It seems like something changed in the --publish syntax ?
It no longer seems to accept the ip::containerPort variant.
Steps to reproduce the issue:
Use "podman run" with
--publish
parameteresDescribe the results you received:
$ sudo podman2 run --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 ubuntu:20.04
Error: must provide a non-empty container host port to publish
Describe the results you expected:
$ sudo podman1 run --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 ubuntu:20.04
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:1.8.2
2.0.0
Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Additional environment details (AWS, VirtualBox, physical, etc.):
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: