名称

podman-system-connection-list - 列出 Podman 服务的目标

简介

podman system connection list [选项]

podman system connection ls [选项]

描述

列出 Podman 服务的 SSH 目标。

选项

--format, -f=format

更改默认输出格式。这可以是支持的类型(如“json”)或 Go 模板。Go 模板的有效占位符如下所示

占位符

描述

.Default

指示连接是否为默认连接

.Identity

包含 SSH 身份的文件路径

.Name

连接名称/标识符

.ReadWrite

指示此连接是否可以使用系统连接命令进行修改

.URI

Podman 服务的 URI。有效方案为 ssh://[用户@]主机[:端口]Unix 域套接字[?secure=True]、unix://Unix 域套接字 和 tcp://[:端口]

--quiet, -q

仅显示连接名称

示例

列出系统连接

$ podman system connection list
Name URI                                                      Identity	    Default  ReadWrite
deva ssh://root@example.com:/run/podman/podman.sock           ~/.ssh/id_rsa true     true
devb ssh://user@example.com:/run/user/1000/podman/podman.sock ~/.ssh/id_rsa false    true

以 JSON 格式显示连接

$ podman system connection list --format json
[
    {
        "Name": "podman-machine-default",
        "URI": "ssh://core@127.0.0.1:53298/run/user/501/podman/podman.sock",
        "Identity": "/Users/ragm/.local/share/containers/podman/machine/machine",
        "IsMachine": true,
        "Default": true,
        "ReadWrite": true
    },
    {
        "Name": "podman-machine-default-root",
        "URI": "ssh://root@127.0.0.1:53298/run/podman/podman.sock",
        "Identity": "/Users/ragm/.local/share/containers/podman/machine/machine",
        "IsMachine": true,
        "Default": false,
        "ReadWrite": true
    }
]

显示连接名称和 URI

$ podman system connection list --format "{{.Name}}\t{{.URI}}"
podman-machine-default	ssh://core@127.0.0.1:53298/run/user/501/podman/podman.sock
podman-machine-default-root	ssh://root@127.0.0.1:53298/run/podman/podman.sock

以综合格式显示所有连接详细信息

$ podman system connection list --format "Name: {{.Name}}\nURI: {{.URI}}\nIdentity: {{.Identity}}\nDefault: {{.Default}}\nReadWrite: {{.ReadWrite}}\n---"
Name: podman-machine-default
URI: ssh://core@127.0.0.1:53298/run/user/501/podman/podman.sock
Identity: /Users/ragm/.local/share/containers/podman/machine/machine
Default: true
ReadWrite: true
---
Name: podman-machine-default-root
URI: ssh://root@127.0.0.1:53298/run/podman/podman.sock
Identity: /Users/ragm/.local/share/containers/podman/machine/machine
Default: false
ReadWrite: true
---

另请参阅

podman(1), podman-system(1), podman-system-connection(1)

历史

2020 年 7 月,最初由 Jhon Honce (jhonce at redhat dot com) 编写