Closed mvmandapati closed 5 months ago
check containers.conf inside the image, https://github.com/containers/image_build/blob/main/podman/containers.conf
As you can see the default netns mode is set to host
so there are no ports. Normally you should get warning like this
Port mappings have been discarded as one of the Host, Container, Pod, and None network modes are in use
.
Seems like this doesn't work when the netns is set in containers.conf though.
Thanks @Luap99.
We were trying to get OpenShift + Jenkins Agent Pods with Rootless Podman working to support CI builds that use testcontainers. Following the blog article https://www.redhat.com/sysadmin/podman-inside-container and trying to use Podman stable image.
If we cant use netns:host
, I guess we can only run testcontainers in rootfull mode.
Well you can just run with --network bridge
to overwrite the default but this might not work if you try to run in an unprivileged pod.
A friendly reminder that this issue had no activity for 30 days.
Thanks @Luap99. Managed to get test containers working inside a pod using your suggestions. This issue can be closed now.
Issue Description
podman inspect returning empty Port bindings when running container inside a rootless podman container. Container starts fine and running podman ps shows the running status.
Running
podman ps --all --format "{{.Names}} {{.Ports}} {{.Mounts}} {{.Status}}"
shows running container with missing ports data.Steps to reproduce the issue
Steps to reproduce the issue
podman run --rm -it --security-opt label=disable --user podman quay.io/podman/stable bash
podman run -d --rm --name postgres -e POSTGRES_PASSWORD=changeit -p 5432:5432 docker.io/postgres:14
podman port --all
which also returns empty response.Describe the results you received
NetworkSettings > Ports is empty
Describe the results you expected
Expected 5432/tcp port binding result.
podman info output
Podman in a container
Yes
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting