podman-port(1)

🌸 podman-port(1) β€” the General Commands Manual era πŸ’…

okay bestie, gather round, because we're talking about podman-port, a lil command from the General Commands Manual family and honestly? it's giving "quietly essential." πŸŽ€


✨ NAME ✨

podman-port β€” list the port mappings for a container πŸ¦‹


✨ SYNOPSIS ✨

podman port [options] container [private-port[/proto]]
podman container port [options] container [private-port[/proto]]

two whole ways to summon it, because Podman said "why not both" πŸ’–


✨ DESCRIPTION ✨

So what does it actually do? It lists the port mappings for the container β€” like, all the vibes of "which inside-port became which outside-port." 🌈

And if you hand it a private-port, it'll look up the public-facing port that's NAT-ed to that private port. It's literally the "who am I on the outside" of container networking. no cap.


✨ OPTIONS ✨

  • --all, -a β€” List all known port mappings for running containers. πŸ‘‘ Big energy, but heads up: when you use this option you cannot also use container names or private ports/protocols as filters. It's all or nothing, periodt.
  • --latest, -l β€” Instead of typing out a container name or ID, just grab the last created container. 🫢 Note: the last started container can be from other users of Podman on the host machine, so like... be aware. Also, this option is not available with the remote Podman client, including Mac and Windows machines (excluding WSL2). πŸ’€

✨ EXAMPLE ✨

List all port mappings β€” the full flex, every mapping, no filter:

# podman port -a
b4d2f05432e482e017b1a4b2eae15fa7b4f6fb7e9f65c1bde46294fdef285906
80/udp -> 0.0.0.0:44327
80/tcp -> 0.0.0.0:44327
#

List port mappings for a specific container β€” just the one, main character style:

# podman port b4d2f054
80/udp -> 0.0.0.0:44327
80/tcp -> 0.0.0.0:44327
#

List the specified port mappings for a specific container β€” narrowing it down to port 80:

# podman port b4d2f054 80
 0.0.0.0:44327
#

List the port mappings for a specific container for port 80 and the tcp protocol β€” being so specific and honestly we love that:

# podman port b4d2f054 80/tcp
0.0.0.0:44327
#

✨ SEE ALSO ✨

podman(1), podman-inspect(1) β€” go read those next, bestie, they're iconic too πŸ’œ


✨ HISTORY ✨

January 2018 β€” originally compiled by Brent Baude <bbaude@redhat.com> 🌸 (yes, an actual email address, the old-school kind, we stan)


okay that's the whole page!! πŸŽ€ this lil rewrite came to you courtesy of the General Commands Manual, page name podman-port(1), and the January 2018 date from the HISTORY section above β€” so if you ever need to cite it, there you go. bye bestie, go check your port mappings πŸ’–βœ¨

πŸ“¦ where this page comes from