-
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
Inspecting a container's exposed ports returns an empty HostIp
#17780
Comments
How are the ports configured when you create the container? For podman no host ip should mean dual stack by default. |
Hi @Luap99, this is how we're configuring the ports when creating the container:
We do this to get a dynamically assigned host port |
A friendly reminder that this issue had no activity for 30 days. |
@Luap99 any follow up on this? |
showing both One can either bind dual stack (no host ip which binds every host address), only ipv4 (0.0.0.0 which means all ipv4 addresses) or only ipv6 (:: which means all ipv6 addresses). Since you do not request a host ip I do not see where the |
This patch adds support for running service using Podman. There are a few notable changes that were required to enable Podman support, described below. Podman keeps `HostIP` empty instead of using `0.0.0.0`. This behavior required an update to `extractIPPort`. More information in containers/podman#17780. Podman prefers to use fully-qualified container images (i.e., `example.com/foo/bar:latest`) but will perform [short-name aliasing](https://github.com/containers/image/blob/main/docs/containers-registries.conf.5.md#short-name-aliasing) for unqualified container images. When an unqualified image such as `foo/bar:latest` is loaded into a kind cluster it will be stored as `localhost/foo/bar:latest`. Using backticks for command substitution isn't POSIX compatible. Switched the backticks to `$()` instead to support alternative shells (e.g., `/bin/fish`).
I think that was changed in podman 5.0 |
Issue Description
I am creating a container with exposed ports. To find the container ports, I inspect the started container. I would expect a list where the host IPs represent IPv4/IPv6 bindings, for example Docker returns:
Note that the HostPort doesn't always match.
From this I can pick the appropriate port depending on IPv4/6 preference. However instead of returning such a list, Podman in the same case is returning:
I do not know what is the status of Podman IPv6 support, regardless I guess the
HostIP
should be either0.0.0.0
or::1
?Steps to reproduce the issue
Describe the results you received
{ "HostIp": "", "HostPort": "50000" }
Describe the results you expected
{ "HostIp": "<something>", "HostPort": "50000" }
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
DOCKER_HOST=unix:///run/user/$(id -u)/podman/podman.sock
Additional information
No response
The text was updated successfully, but these errors were encountered: