Expoising ports automatically
Hi, Newbie question... I'm playing out with rootless container based on: docker.io/library/mysql If I run this image (without specifying ports or volumes) it will create a volume automatically. I did "inspect" the image and I see the volume is defined there. I also noticed the ExposedPorts as well but podman didn't create theses. Why would it create the volume but not expose the ports (if they're available and above 1024)? Thanks, Jorge
On 8/30/21 14:34, Jorge Fábregas wrote:
Hi,
Newbie question... I'm playing out with rootless container based on:
docker.io/library/mysql
If I run this image (without specifying ports or volumes) it will create a volume automatically. I did "inspect" the image and I see the volume is defined there. I also noticed the ExposedPorts as well but podman didn't create theses. Why would it create the volume but not expose the ports (if they're available and above 1024)?
Thanks, Jorge _______________________________________________ Podman mailing list -- podman@lists.podman.io To unsubscribe send an email to podman-leave@lists.podman.io
You need to run podman run --publish-all (-P) in order to publish ports defined within a container image. Since these ports are potentially exposed to the internet, this does not happen automatically. BTW You will still need to open the firewall rules, to allow access to the ports from external sites.
On 9/1/21 9:38 AM, Daniel Walsh wrote:
You need to run podman run --publish-all (-P) in order to publish ports defined within a container image.
Arghh -P that's the one.
Since these ports are potentially exposed to the internet, this does not happen automatically. BTW You will still need to open the firewall rules, to allow access to the ports from external sites.
I see. It makes total sense. As always, thanks Dan!
participants (2)
-
Daniel Walsh -
Jorge Fábregas