diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-06-28 11:06:46 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-06-29 09:33:43 -0400 |
commit | 3601b96600807214d74b9c77c614fa03bfae30a8 (patch) | |
tree | d4ef8ad521dcd4c8660e04305ed0f19d3200c175 /docs/source/markdown/podman-run.1.md | |
parent | 673116c063f173ae7ff799a920f9c1ca28194b9d (diff) | |
download | podman-3601b96600807214d74b9c77c614fa03bfae30a8.tar.gz podman-3601b96600807214d74b9c77c614fa03bfae30a8.tar.bz2 podman-3601b96600807214d74b9c77c614fa03bfae30a8.zip |
Allow empty host port in --publish flag
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 #6806
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'docs/source/markdown/podman-run.1.md')
-rw-r--r-- | docs/source/markdown/podman-run.1.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/docs/source/markdown/podman-run.1.md b/docs/source/markdown/podman-run.1.md index 88666d595..7010b13e8 100644 --- a/docs/source/markdown/podman-run.1.md +++ b/docs/source/markdown/podman-run.1.md @@ -636,6 +636,9 @@ Both hostPort and containerPort can be specified as a range of ports. When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. +Host port does not have to be specified (e.g. `podman run -p 127.0.0.1::80`). +If it is not, the container port will be randomly assigned a port on the host. + Use **podman port** to see the actual mapping: **podman port $CONTAINER $CONTAINERPORT**. **--publish-all**, **-P**=**true**|**false** |