podman search centos INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED Podman.io Podman.io/blacklabelops/centos CentOS Base Image! Built and Updates Daily! 1 [ok]
INDEX NAME 镜像名字 DESCRIPTION 描述 SATRS 星级 数字越大代表使用人数越多 OFFICIAL 是否为官方镜像 AUTOMATED
COMMANDS: build Build an image using instructions from Podmanfiles #根据Podmanfiles创建image history Show history of a specified image #显示指定镜像的历史信息 import Import a tarball to create a filesystem image #导入一个文件系统压缩包 exists Check if an image exists inlocal storage #检查本地是否存在某个镜像 inspect Displays the configuration of a container or image #显示容器或镜像的详细信息 load Load an image from Podman archive #将镜像文件导入到镜像仓库 list, ls list images inlocal storage #列出本地存储中的镜像 prune Remove unused images #移除未使用的镜像 pull Pull an image from a registry #下载一个镜像到本地 push Push an image to a specified destination #上传一个镜像到仓库 rm removes one or more images from local storage #删除一个或多个本地镜像 save Save image to an archive #将一个镜像保存为一个镜像文件 tag Add an additional name to a local image #添加一个额外的名称给本地镜像 trust Manage container image trust policy #信任容器镜像 sign Sign an image #生成镜像签名,可以根据签名验证镜像的完整性
OPTIONS: --help, -h show help
镜像历史信息
1 2 3 4 5 6 7 8
podman image history 73f5fb57a402 ID CREATED CREATED BY SIZE COMMENT 73f5fb57a402 13 months ago /bin/sh -c #(nop) LABEL maintainer=Steffen... 0B <missing> 13 months ago |1 BUILD_DATE=06/10/2018-01:06+0200 /bin/s... 64.2MB <missing> 13 months ago /bin/sh -c #(nop) ARG BUILD_DATE=undefined 64.2MB <missing> 15 months ago /bin/sh -c #(nop) CMD ["/bin/bash"] 64.2MB <missing> 15 months ago /bin/sh -c #(nop) LABEL name=CentOS Base I... 64.2MB <missing> 15 months ago /bin/sh -c #(nop) ADD file:d6a1da927f0b7a7... 73.36MB
podman image tag 2d42f6c756bc tyschool_centos8_1905 podman image list REPOSITORY TAG IMAGE ID CREATED SIZE localhost/tyschool_centos8_1905 latest 2d42f6c756bc 5 hours ago 1.4 GB
#显示开机容器 [root@node4 ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
#显示所有容器,包括没开机的 [root@node4 ~]# podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 344ce4a0a6b4 localhost/tyschool_centos8_1905:latest /bin/bash 54 seconds ago Exited (0) 50 seconds ago ty2 78c97bb19bec docker.io/mcnaughton/centos-base:latest /bin/bash 3 minutes ago Exited (0) About a minute ago ty1
容器创建 run
方法一:根据本地镜像创建容器
1 2 3 4 5
podman images REPOSITORY TAG IMAGE ID CREATED SIZE localhost/tyschool_centos8_1905 latest 2d42f6c756bc 7 hours ago 1.4 GB docker.io/blacklabelops/centos latest 73f5fb57a402 13 months ago 391 MB podman run -it -name ty2 localhost/tyschool_centos8_1905 /bin/bash
#启动容器 start podman start ty1 ty1 #查看容器开启了 podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 78c97bb19bec docker.io/mcnaughton/centos-base:latest /bin/bash 4 minutes ago Up 5 seconds ago ty1
#关闭容器 stop podman stop ty1 78c97bb19bec488b8bf5a6f68cdff9ecc20980b3c2c9e2d4c56a0946f539bd02 #查看容器关闭了 podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 78c97bb19bec docker.io/mcnaughton/centos-base:latest /bin/bash 6 minutes ago Up 2 seconds ago ty1
#暂停容器 pause podman pause ty1 78c97bb19bec488b8bf5a6f68cdff9ecc20980b3c2c9e2d4c56a0946f539bd02 #查看状态 podman ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 344ce4a0a6b4 localhost/tyschool_centos8_1905:latest /bin/bash 4 minutes ago Exited (0) 4 minutes ago ty2 78c97bb19bec docker.io/mcnaughton/centos-base:latest /bin/bash 6 minutes ago Paused ty1
#恢复暂停容器 unpause [root@node4 ~]# podman unpause ty1 78c97bb19bec488b8bf5a6f68cdff9ecc20980b3c2c9e2d4c56a0946f539bd02 查看状态 [root@node4 ~]# podman ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 78c97bb19bec docker.io/mcnaughton/centos-base:latest /bin/bash 6 minutes ago Up 25 seconds ago ty1
容器性能查看 top
用法: podman top 容器名称
1 2 3
podman top ty1 USER PID PPID %CPU ELAPSED TTY TIME COMMAND root 1 0 0.000 6m9.377354027s pts/0 0s /bin/bash