NAME¶ 名称
podman-info - Display Podman related system information
podman-info - 显示与 Podman 相关的系统信息
SYNOPSIS¶ 概要
podman info [options] podman 信息 [选项]
podman system info [options]
podman 系统信息 [选项]
DESCRIPTION¶ 描述
Displays information pertinent to the host, current storage stats, configured container registries, and build of podman.
显示与主机、当前存储统计信息、配置的容器注册表和 podman 构建相关的信息。
OPTIONS¶ 选项
--format, -f=format¶
Change output format to “json” or a Go template.
将输出格式更改为“json”或 Go 模板。
Placeholder |
Info pertaining to … 有关... |
---|---|
.Host … .主机 … |
…the host on which podman is running |
.Plugins … .插件 … |
…external plugins …外部插件 |
.Registries … .注册表 … |
…configured registries …配置的注册表 |
.Store … .存储 … |
…the storage driver and paths |
.Version … .版本 … |
…podman version ...podman 版本 |
Each of the above branch out into further subfields, more than can
reasonably be enumerated in this document.
上述每个分支都进一步分支出更多的子领域,超出了本文档中可以合理列举的范围。
EXAMPLES¶ 示例
Run podman info
for a YAML formatted response:
运行 podman info
以获取一个格式为 YAML 的响应:
$ podman info
host:
arch: amd64
buildahVersion: 1.23.0
cgroupControllers: []
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon-2.0.29-2.fc34.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.0.29, commit: '
cpu_utilization:
idle_percent: 96.84
system_percent: 0.71
user_percent: 2.45
cpus: 8
distribution:
distribution: fedora
variant: workstation
version: "34"
eventLogger: journald
hostname: localhost.localdomain
idMappings:
gidmap:
- container_id: 0
host_id: 3267
size: 1
- container_id: 1
host_id: 100000
size: 65536
uidmap:
- container_id: 0
host_id: 3267
size: 1
- container_id: 1
host_id: 100000
size: 65536
kernel: 5.13.13-200.fc34.x86_64
linkmode: dynamic
logDriver: journald
memFree: 1833385984
memTotal: 16401895424
networkBackend: cni
networkBackendInfo:
backend: cni
dns:
package: podman-plugins-3.4.4-1.fc34.x86_64
path: /usr/libexec/cni/dnsname
version: |-
CNI dnsname plugin
version: 1.3.1
commit: unknown
package: |-
containernetworking-plugins-1.0.1-1.fc34.x86_64
podman-plugins-3.4.4-1.fc34.x86_64
path: /usr/libexec/cni
ociRuntime:
name: crun
package: crun-1.0-1.fc34.x86_64
path: /usr/bin/crun
version: |-
crun version 1.0
commit: 139dc6971e2f1d931af520188763e984d6cdfbf8
spec: 1.0.0
+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
os: linux
pasta:
executable: /usr/bin/passt
package: passt-0^20221116.gace074c-1.fc34.x86_64
version: |
passt 0^20221116.gace074c-1.fc34.x86_64
Copyright Red Hat
GNU Affero GPL version 3 or later <https://www.gnu.org/licenses/agpl-3.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
remoteSocket:
path: /run/user/3267/podman/podman.sock
security:
apparmorEnabled: false
capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID
rootless: true
seccompEnabled: true
seccompProfilePath: /usr/share/containers/seccomp.json
selinuxEnabled: true
serviceIsRemote: false
slirp4netns:
executable: /bin/slirp4netns
package: slirp4netns-1.1.12-2.fc34.x86_64
version: |-
slirp4netns version 1.1.12
commit: 7a104a101aa3278a2152351a082a6df71f57c9a3
libslirp: 4.4.0
SLIRP_CONFIG_VERSION_MAX: 3
libseccomp: 2.5.0
swapFree: 15687475200
swapTotal: 16886259712
uptime: 47h 15m 9.91s (Approximately 1.96 days)
plugins:
log:
- k8s-file
- none
- journald
network:
- bridge
- macvlan
volume:
- local
registries:
search:
- registry.fedoraproject.org
- registry.access.redhat.com
- docker.io
- quay.io
store:
configFile: /home/dwalsh/.config/containers/storage.conf
containerStore:
number: 9
paused: 0
running: 1
stopped: 8
graphDriverName: overlay
graphOptions: {}
graphRoot: /home/dwalsh/.local/share/containers/storage
graphRootAllocated: 510389125120
graphRootUsed: 129170714624
graphStatus:
Backing Filesystem: extfs
Native Overlay Diff: "true"
Supports d_type: "true"
Using metacopy: "false"
imageCopyTmpDir: /home/dwalsh/.local/share/containers/storage/tmp
imageStore:
number: 5
runRoot: /run/user/3267/containers
transientStore: false
volumePath: /home/dwalsh/.local/share/containers/storage/volumes
version:
APIVersion: 4.0.0
Built: 1631648722
BuiltTime: Tue Sep 14 15:45:22 2021
GitCommit: 23677f92dd83e96d2bc8f0acb611865fb8b1a56d
GoVersion: go1.16.6
OsArch: linux/amd64
Version: 4.0.0
Run podman info --format json
for a JSON formatted response:
运行 podman info --format json
以获取 JSON 格式的响应:
$ podman info --format json
{
"host": {
"arch": "amd64",
"buildahVersion": "1.23.0",
"cgroupManager": "systemd",
"cgroupVersion": "v2",
"cgroupControllers": [],
"conmon": {
"package": "conmon-2.0.29-2.fc34.x86_64",
"path": "/usr/bin/conmon",
"version": "conmon version 2.0.29, commit: "
},
"cpus": 8,
"distribution": {
"distribution": "fedora",
"version": "34"
},
"eventLogger": "journald",
"hostname": "localhost.localdomain",
"idMappings": {
"gidmap": [
{
"container_id": 0,
"host_id": 3267,
"size": 1
},
{
"container_id": 1,
"host_id": 100000,
"size": 65536
}
],
"uidmap": [
{
"container_id": 0,
"host_id": 3267,
"size": 1
},
{
"container_id": 1,
"host_id": 100000,
"size": 65536
}
]
},
"kernel": "5.13.13-200.fc34.x86_64",
"logDriver": "journald",
"memFree": 1785753600,
"memTotal": 16401895424,
"networkBackend": "cni",
"networkBackendInfo": {
"backend": "cni",
"package": "containernetworking-plugins-1.0.1-1.fc34.x86_64\npodman-plugins-3.4.4-1.fc34.x86_64",
"path": "/usr/libexec/cni",
"dns": {
"version": "CNI dnsname plugin\nversion: 1.3.1\ncommit: unknown",
"package": "podman-plugins-3.4.4-1.fc34.x86_64",
"path": "/usr/libexec/cni/dnsname"
}
},
"ociRuntime": {
"name": "crun",
"package": "crun-1.0-1.fc34.x86_64",
"path": "/usr/bin/crun",
"version": "crun version 1.0\ncommit: 139dc6971e2f1d931af520188763e984d6cdfbf8\nspec: 1.0.0\n+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL"
},
"os": "linux",
"remoteSocket": {
"path": "/run/user/3267/podman/podman.sock"
},
"serviceIsRemote": false,
"security": {
"apparmorEnabled": false,
"capabilities": "CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID",
"rootless": true,
"seccompEnabled": true,
"seccompProfilePath": "/usr/share/containers/seccomp.json",
"selinuxEnabled": true
},
"slirp4netns": {
"executable": "/bin/slirp4netns",
"package": "slirp4netns-1.1.12-2.fc34.x86_64",
"version": "slirp4netns version 1.1.12\ncommit: 7a104a101aa3278a2152351a082a6df71f57c9a3\nlibslirp: 4.4.0\nSLIRP_CONFIG_VERSION_MAX: 3\nlibseccomp: 2.5.0"
},
"pasta": {
"executable": "/usr/bin/passt",
"package": "passt-0^20221116.gace074c-1.fc34.x86_64",
"version": "passt 0^20221116.gace074c-1.fc34.x86_64\nCopyright Red Hat\nGNU Affero GPL version 3 or later \u003chttps://www.gnu.org/licenses/agpl-3.0.html\u003e\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\n"
},
"swapFree": 15687475200,
"swapTotal": 16886259712,
"uptime": "47h 17m 29.75s (Approximately 1.96 days)",
"linkmode": "dynamic"
},
"store": {
"configFile": "/home/dwalsh/.config/containers/storage.conf",
"containerStore": {
"number": 9,
"paused": 0,
"running": 1,
"stopped": 8
},
"graphDriverName": "overlay",
"graphOptions": {
},
"graphRoot": "/home/dwalsh/.local/share/containers/storage",
"graphStatus": {
"Backing Filesystem": "extfs",
"Native Overlay Diff": "true",
"Supports d_type": "true",
"Using metacopy": "false"
},
"imageCopyTmpDir": "/home/dwalsh/.local/share/containers/storage/tmp",
"imageStore": {
"number": 5
},
"runRoot": "/run/user/3267/containers",
"volumePath": "/home/dwalsh/.local/share/containers/storage/volumes",
"transientStore": false
},
"registries": {
"search": [
"registry.fedoraproject.org",
"registry.access.redhat.com",
"docker.io",
"quay.io"
]
},
"plugins": {
"volume": [
"local"
],
"network": [
"bridge",
"macvlan"
],
"log": [
"k8s-file",
"none",
"journald"
]
},
"version": {
"APIVersion": "4.0.0",
"Version": "4.0.0",
"GoVersion": "go1.16.6",
"GitCommit": "23677f92dd83e96d2bc8f0acb611865fb8b1a56d",
"BuiltTime": "Tue Sep 14 15:45:22 2021",
"Built": 1631648722,
"OsArch": "linux/amd64"
}
}
Extracting the list of container registries with a Go template¶
使用 Go 模板提取容器注册表列表 ¶
If shell completion is enabled, type podman info --format={{.
and then press [TAB]
twice.
如果启用了 shell 自动补全,请输入 podman info --format={{.
然后按两次 [TAB]
。
$ podman info --format={{.
{{.Host. {{.Plugins. {{.Registries}} {{.Store. {{.Version.
Press R
[TAB]
[ENTER]
to print the registries information.
按 R
[TAB]
[ENTER]
键打印注册表信息。
$ podman info -f {{.Registries}}
map[search:[registry.fedoraproject.org registry.access.redhat.com docker.io quay.io]]
$
The output still contains a map and an array. The map value can be extracted with
输出仍然包含一个映射和一个数组。可以提取映射值
$ podman info -f '{{index .Registries "search"}}'
[registry.fedoraproject.org registry.access.redhat.com docker.io quay.io]
The array can be printed as one entry per line
数组可以逐行打印为一个条目
$ podman info -f '{{range index .Registries "search"}}{{.}}\n{{end}}'
registry.fedoraproject.org
registry.access.redhat.com
docker.io
quay.io
Extracting the list of container registries from JSON with jq¶
使用 jq 从 JSON 中提取容器注册表列表 ¶
The command-line JSON processor jq can be used to extract the list
of container registries.
命令行 JSON 处理器 jq 可用于提取容器注册表列表。
$ podman info -f json | jq '.registries["search"]'
[
"registry.fedoraproject.org",
"registry.access.redhat.com",
"docker.io",
"quay.io"
]
The array can be printed as one entry per line
数组可以打印为每行一个条目
$ podman info -f json | jq -r '.registries["search"] | .[]'
registry.fedoraproject.org
registry.access.redhat.com
docker.io
quay.io
Note, the Go template struct fields start with upper case. When running podman info
or podman info --format=json
, the same names start with lower case.
注意,Go 模板结构字段以大写字母开头。运行 podman info
或 podman info --format=json
时,相同的名称以小写字母开头。
SEE ALSO¶ 参见 ¶
podman(1), containers-registries.conf(5), containers-storage.conf(5)