NAME 名称

podman-port - List port mappings for a container
podman-port - 列出容器的端口映射

SYNOPSIS 概要

podman port [options] container [private-port[/proto]]
podman port [选项] 容器 [私有端口/协议]

podman container port [options] container [private-port[/proto]]
podman container port [选项] 容器 [私有端口/协议]

DESCRIPTION 描述

List port mappings for the container or look up the public-facing port that is NAT-ed to the private-port.
列出容器的端口映射,或查找 NAT 到私有端口的公共端口。

OPTIONS 选项

--all, -a

List all known port mappings for running containers; when using this option, container names or private ports/protocols filters cannot be used.
列出所有正在运行的容器的所有已知端口映射;使用此选项时,无法使用容器名称或私有端口/协议过滤器。

--latest, -l

Instead of providing the container name or ID, use the last created container. Note: the last started container can be from other users of Podman on the host machine. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
不要提供容器名称或 ID,而是使用最后创建的容器。注意:最后启动的容器可能来自主机上其他 Podman 用户。(此选项在远程 Podman 客户端中不可用,包括 Mac 和 Windows(不包括 WSL2)主机)

EXAMPLE 例子 ¶

List all port mappings:
列出所有端口映射:

# 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:
列出特定容器的端口映射:

# 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:
列出特定容器的指定端口映射:

# podman port b4d2f054 80
 0.0.0.0:44327
#

List the port mappings for a specific container for port 80 and the tcp protocol:
列出特定容器的端口映射,端口为 80,协议为 tcp:

# podman port b4d2f054 80/tcp
0.0.0.0:44327
#

SEE ALSO 参见 ¶

podman(1), podman-inspect(1)

HISTORY 历史 ¶

January 2018, Originally compiled by Brent Baude bbaude@redhat.com
2018 年 1 月,最初由 Brent Baude bbaude@redhat.com 编译