You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, this is a strange one.. I'm trying to run a webserver (Caddy) as systemd service that is connected to two podman networks, one of which has been created externally (to the service).
However, I noticed that the published container ports (80 and 443) are unavailable when run as systemd unit, but the exact same command works without issues when run directly from a root tty (in both cases, the container is run as root).
The problem goes away if I do not connect it to the previously created network
Steps to reproduce the issue
Steps to reproduce the issue
Create and start a service like this:
cat <<EOF > /etc/systemd/system/caddy.service[Service]Type=execNotifyAccess=allExecStartPre=/bin/bash -c '/usr/bin/podman network inspect public >/dev/null 2>&1 || /usr/bin/podman network create public'ExecStartPre=-/usr/bin/podman rm caddyExecStartPre=/usr/bin/podman create \ --network public \ -p 80:80 \ --name caddy \ docker.io/caddy:2# Network 'internal' has been created previously by another serviceExecStartPre=/usr/bin/podman network connect internal caddyExecStart=/usr/bin/podman start --attach caddyExecStop=/usr/bin/podman rm nca-caddyEOF
systemctl daemon-reload
systemctl start caddy
Test whether you can reach the container at its published port
curl -v http://localhost:80
-> observe a timeout
Test whether you can reach the container at its ip address
podman is running inside an incus container. The rootfs has been built with buildroot (hence I'm unfortunately stuck with the podman version that's supported by buildroot).
Additional information
No response
The text was updated successfully, but these errors were encountered:
Issue Description
So, this is a strange one.. I'm trying to run a webserver (Caddy) as systemd service that is connected to two podman networks, one of which has been created externally (to the service).
However, I noticed that the published container ports (80 and 443) are unavailable when run as systemd unit, but the exact same command works without issues when run directly from a root tty (in both cases, the container is run as root).
The problem goes away if I do not connect it to the previously created network
Steps to reproduce the issue
Steps to reproduce the issue
Create and start a service like this:
Test whether you can reach the container at its published port
-> observe a timeout
Test whether you can reach the container at its ip address
Disconnect the container from the "internal" network
Test whether you can reach the container at its published port
--> successfully retrieve the default caddy page
Stop the service and replicate the container without systemd
systemctl stop caddy podman rm caddy #just to be sure podman create \ --network public \ -p 80:80 \ --name caddy \ docker.io/caddy:2 podman network connect internal caddy podman start caddy
Test whether you can reach the container at its published port
--> successfully retrieve the default caddy page
Test whether you can reach the container at its ip address
Describe the results you received
The port binding doesn't work and the container can't be reach at its published port.
Describe the results you expected
The port binding should just work and the container should be accessible at http://localhost
podman info output
Podman in a container
Yes
Privileged Or Rootless
None
Upstream Latest Release
No
Additional environment details
podman is running inside an incus container. The rootfs has been built with buildroot (hence I'm unfortunately stuck with the podman version that's supported by buildroot).
Additional information
No response
The text was updated successfully, but these errors were encountered: