podman

podman

podman简述

Podman 是一个开源项目,可在大多数 Linux 平台上使用,并位于GitHub 上。Podman 是一个无守护进程的容器引擎,用于在 Linux 系统上开发、管理和运行 Open Container Initiative (OCI) 容器和容器映像。Podman 提供了一个与 Docker 兼容的命令行前端,它可以简单地为 Docker cli ,alias docker=podman。Podman 还提供了一个套接字激活的 REST API 服务,以允许远程应用程序启动按需容器。此 REST API 还支持 Docker API,允许 docker-py 和 docker-compose 的用户与 Podman 作为服务进行交互。

Podman 控制下的容器可以由 root 或非特权用户运行。Podman 使用libpod库管理整个容器生态系统,包括 pod、容器、容器映像和容器卷。Podman 专注于帮助您维护和修改 OCI 容器镜像的所有命令和功能,例如拉取和标记。它允许您在生产环境中创建、运行和维护从这些映像创建的容器。

Podman 服务仅在 Linux 平台上运行,但 podman 远程 REST API 客户端存在于 Mac 和 Windows 平台上,并且可以通过 ssh 与运行在 Linux 机器或 VM 上的 Podman 服务进行通信。Mac 客户端。

podman官网

Podman与Docker的区别

  • 最主要的区别是podman是Daemonless的,而Docker在执行任务的时候,必须依赖于后台的docker daemon(最主要的区别)
  • podman不需要使用root用户或者root权限,所以更安全。(最主要的区别)
  • podman可以创建pod,pod的概念和Kubernetes 里定义的pod类似
  • podman运行把镜像和容器存储在不同的地方,但是docker必须存储在docker engineer所在的本地
  • podman是传统的fork-exec 模式,而docker是 client-server 架构

Podman架构

preview

podman安装

[root@167 ~]# dnf -y install podman
CentOS Stream 8 - AppStream                                 4.8 kB/s | 4.4 kB     00:00    
CentOS Stream 8 - AppStream                                  14 MB/s |  24 MB     00:01    
CentOS Stream 8 - BaseOS                                    5.9 kB/s | 3.9 kB     00:00    
CentOS Stream 8 - BaseOS                                    1.2 MB/s |  25 MB     00:21    
CentOS Stream 8 - Extras                                    4.2 kB/s | 2.9 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64               20 kB/s | 7.1 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64               12 MB/s |  13 MB     00:01    
Extra Packages for Enterprise Linux Modular 8 - x86_64       23 kB/s | 7.0 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64      1.2 MB/s | 857 kB     00:00    
.............
Installed:
  checkpolicy-2.9-1.el8.x86_64                                                              
  conmon-2:2.1.0-1.module_el8.7.0+1106+45480ee0.x86_64                                      
  container-selinux-2:2.180.0-1.module_el8.7.0+1106+45480ee0.noarch                         
  containernetworking-plugins-1:1.1.1-1.module_el8.7.0+1106+45480ee0.x86_64                 
  containers-common-2:1-23.module_el8.7.0+1106+45480ee0.x86_64                              
  criu-3.15-3.module_el8.6.0+926+8bef8ae7.x86_64                                            
  fuse-overlayfs-1.8.2-1.module_el8.7.0+1106+45480ee0.x86_64                                
  fuse3-3.3.0-16.el8.x86_64                                                                 
  fuse3-libs-3.3.0-16.el8.x86_64                                                            
  libnet-1.1.6-15.el8.x86_64                                                                
  libslirp-4.4.0-1.module_el8.6.0+926+8bef8ae7.x86_64                                       
  podman-2:4.0.2-1.module_el8.7.0+1106+45480ee0.x86_64                                      
  podman-catatonit-2:4.0.2-1.module_el8.7.0+1106+45480ee0.x86_64                            
  policycoreutils-python-utils-2.9-18.el8.noarch                                            
  protobuf-c-1.3.0-6.el8.x86_64                                                             
  python3-audit-3.0.7-1.el8.x86_64                                                          
  python3-libsemanage-2.9-6.el8.x86_64                                                      
  python3-policycoreutils-2.9-18.el8.noarch                                                 
  python3-setools-4.3.0-3.el8.x86_64                                                        
  runc-1:1.0.3-3.module_el8.7.0+1106+45480ee0.x86_64                                        
  shadow-utils-subid-2:4.6-17.el8.x86_64                                                    
  slirp4netns-1.1.8-2.module_el8.7.0+1106+45480ee0.x86_64                                   

Complete!
[root@167 ~]# 

podman配置

[root@167 ~]# alias docker=podman
[root@167 ~]# rpm -qa | grep docker
[root@167 ~]# docker images
REPOSITORY  TAG         IMAGE ID    CREATED     SIZE
[root@167 ~]# vim /root/.bashrc 
[root@167 ~]# cat /root/.bashrc 
# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias docker='podman'
# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi
[root@167 ~]# source /root/.bashrc 
//加速器
[[registry]]
prefix = "docker.io"
location = "docker.mirrors.ustc.edu.cn"
//镜像源,写一个地址则只在一个源里查找镜像,写多个地址则在多个
unqualified-search-registries = ["docker.io"]

podman用法

//查看版本

[root@167 ~]# podman -v
podman version 4.0.2
[root@167 ~]# podman version 
Client:       Podman Engine
Version:      4.0.2
API Version:  4.0.2
Go Version:   go1.17.7

Built:      Wed Mar 16 03:15:06 2022
OS/Arch:    linux/amd64
[root@167 ~]# podman info   //查看详细信息
host:
  arch: amd64
  buildahVersion: 1.24.1
  ...........
version:
  APIVersion: 4.0.2
  Built: 1647371706
  BuiltTime: Wed Mar 16 03:15:06 2022
  GitCommit: ""
  GoVersion: go1.17.7
  OsArch: linux/amd64
  Version: 4.0.2
[root@167 ~]# 

//登入和登出

[root@167 ~]# podman login docker.io
Username: wanli123
Password: 
Login Succeeded!
[root@167 ~]# podman logout docker.io 
Removed login credentials for docker.io
[root@167 ~]# 

image镜像管理子命令

build

//基于dockerfile创建镜像

diff

//检查映像文件系统的更改

[root@167 ~]# podman diff httpd
C /usr
C /usr/local
C /usr/local/bin
A /usr/local/bin/httpd-foreground
[root@167 ~]# 

history

//显示指定镜像的历史记录

[root@167 ~]# podman image history httpd
ID            CREATED      CREATED BY                                     SIZE              COMMENT
f2a976f932ec  12 days ago  /bin/sh -c #(nop)  CMD ["httpd-foreground"]    0 B               
<missing>     12 days ago  /bin/sh -c #(nop)  EXPOSE 80                   0 B               
<missing>     12 days ago  /bin/sh -c #(nop) COPY file:c432ff61c4993e...  3.58 kB           
<missing>     12 days ago  /bin/sh -c #(nop)  STOPSIGNAL SIGWINCH         0 B               
<missing>     12 days ago  /bin/sh -c set -eux;                                             savedAptMark="$(apt...  60.4 MB     
<missing>     12 days ago  /bin/sh -c #(nop)  ENV HTTPD_PATCHES=          0 B               
<missing>     12 days ago  /bin/sh -c #(nop)  ENV HTTPD_SHA256=eb397f...  0 B               
<missing>     12 days ago  /bin/sh -c #(nop)  ENV HTTPD_VERSION=2.4.54    0 B               
<missing>     12 days ago  /bin/sh -c set -eux;                           apt-get update;   apt...      5.1 MB      
<missing>     12 days ago  /bin/sh -c #(nop) WORKDIR /usr/local/apache2   0 B               
<missing>     12 days ago  /bin/sh -c mkdir -p "$HTTPD_PREFIX"            && ch...          3.07 kB     
<missing>     12 days ago  /bin/sh -c #(nop)  ENV PATH=/usr/local/apa...  0 B               
<missing>     12 days ago  /bin/sh -c #(nop)  ENV HTTPD_PREFIX=/usr/l...  0 B               
<missing>     13 days ago  /bin/sh -c #(nop)  CMD ["bash"]                0 B               
<missing>     13 days ago  /bin/sh -c #(nop) ADD file:0eae0dca665c704...  83.9 MB           
[root@167 ~]# 

inspect

//显示镜像的配置

[root@167 ~]# podman image inspect httpd
[
     {
          "Id": "f2a976f932ec6fe48978c1cdde2c8217a497b1f080c80e49049e02757302cf74",
          "Digest": "sha256:343452ec820a5d59eb3ab9aaa6201d193f91c3354f8c4f29705796d9353d4cc6",
          "RepoTags": [
               "docker.io/library/httpd:latest"
          ],
          "RepoDigests": [
               "docker.io/library/httpd@sha256:343452ec820a5d59eb3ab9aaa6201d193f91c3354f8c4f29705796d9353d4cc6",
               "docker.io/library/httpd@sha256:98778663b10c3952e9d7dd8a10e1ca2a8ce31f11b5f0ff9d7b3b36ddb8201db8"
          ],
............
          ],
          "NamesHistory": [
               "docker.io/library/httpd:latest"
          ]
     }
]

list

//列出本地存储中镜像

[root@167 ~]# podman image list
REPOSITORY                 TAG         IMAGE ID      CREATED      SIZE
docker.io/library/httpd    latest      f2a976f932ec  12 days ago  149 MB
docker.io/library/busybox  latest      7a80323521cc  2 weeks ago  1.47 MB
[root@167 ~]# 

rm

//删除镜像

[root@167 ~]# podman image rm busybox
Untagged: docker.io/library/busybox:latest
Deleted: 7a80323521ccd4c2b4b423fa6e38e5cea156600f40cd855e464cc52a321a24dd
[root@167 ~]# podman image list
REPOSITORY               TAG         IMAGE ID      CREATED      SIZE
docker.io/library/httpd  latest      f2a976f932ec  12 days ago  149 MB
[root@167 ~]# 

save

//将镜像保存到本地

[root@167 ~]# podman image save httpd > http.tar
[root@167 ~]# ls
anaconda-ks.cfg  http.tar  test.sh
[root@167 ~]# 

load

//从tar存档加载镜像

[root@167 ~]# podman image load < http.tar 
Getting image source signatures
Copying blob 0c2dead5c030 skipped: already exists  
Copying blob 92a4e8a3140f skipped: already exists  
Copying blob eea65516ea3b skipped: already exists  
Copying blob 28a53545632f skipped: already exists  
Copying blob 54fa52c69e00 skipped: already exists  
Copying config f2a976f932 done  
Writing manifest to image destination
Storing signatures
Loaded image(s): docker.io/library/httpd:latest
[root@167 ~]# podman image list
REPOSITORY               TAG         IMAGE ID      CREATED      SIZE
docker.io/library/httpd  latest      f2a976f932ec  12 days ago  149 MB
[root@167 ~]# 

prune

//删除未使用的镜像

[root@167 ~]# podman image prune
WARNING! This command removes all dangling images.
Are you sure you want to continue? [y/N] y

search

//搜索镜像

[root@167 ~]# podman image search httpd
NAME                                          DESCRIPTION
registry.fedoraproject.org/f29/httpd          
registry.centos.org/centos/httpd              
registry.centos.org/centos/httpd-24-centos7   
registry.centos.org/centos/lighttpd           
registry.centos.org/sclo/httpd-24-centos7     
docker.io/library/httpd                       The Apache HTTP Server Project
docker.io/clearlinux/httpd                    httpd HyperText Transfer Protocol (HTTP) server program with the benefits of Clear Linux OS
docker.io/centos/httpd-24-centos7             Platform for running Apache httpd 2.4 or building httpd-based application 
docker.io/manageiq/httpd                      Container with httpd, built on CentOS for ManageIQ.
docker.io/centos/httpd-24-centos8             
docker.io/dockerpinata/httpd                  
docker.io/19022021/httpd-connection_test      This httpd image will test the connectivity of the endpoint.
docker.io/centos/httpd                        
docker.io/e2eteam/httpd                       
docker.io/publici/httpd                       httpd:latest
docker.io/paketobuildpacks/httpd              
docker.io/manasip/httpd                       
docker.io/httpdocker/kubia                    
docker.io/solsson/httpd-openidc               mod_auth_openidc on official httpd image, verified with Keycloak using docker-compose
docker.io/manageiq/httpd_configmap_generator  Httpd Configmap Generator
docker.io/amd64/httpd                         The Apache HTTP Server Project
docker.io/patrickha/httpd-err                 
docker.io/hypoport/httpd-cgi                  httpd-cgi
docker.io/inanimate/httpd-ssl                 A play container with httpd, ssl enabled, and PLAY certs incorporated!
docker.io/httpdss/archerysec                  ArcherySec repository
docker.io/dariko/httpd-rproxy-ldap            Apache httpd reverse proxy with LDAP authentication
docker.io/sandeep1988/httpd-new               httpd-new
docker.io/nnasaki/httpd-ssi                   SSI enabled Apache 2.4 on Alpine Linux
docker.io/ppc64le/httpd                       The Apache HTTP Server Project
docker.io/sherazahmedvaival/httpd-php-fpm74   
[root@167 ~]# 

pull

//拉取镜像

[root@167 ~]# podman image pull busybox
Resolved "busybox" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/busybox:latest...
Getting image source signatures
Copying blob 50783e0dfb64 done  
Copying config 7a80323521 done  
Writing manifest to image destination
Storing signatures
7a80323521ccd4c2b4b423fa6e38e5cea156600f40cd855e464cc52a321a24dd
[root@167 ~]# 

tag

//对镜像修改标签

[root@167 ~]# podman tag busybox wanli123/busybox:v0.1
[root@167 ~]# podman image list
REPOSITORY                  TAG         IMAGE ID      CREATED      SIZE
docker.io/library/httpd     latest      f2a976f932ec  12 days ago  149 MB
docker.io/library/busybox   latest      7a80323521cc  2 weeks ago  1.47 MB
localhost/wanli123/busybox  v0.1        7a80323521cc  2 weeks ago  1.47 MB
[root@167 ~]# 

push

//上传镜像

示例
先打标签,改名
命名规则:自己的账户名/镜像名:版本号(标签)

history

//显示镜像的历史记录

[root@167 ~]# podman history busybox
ID            CREATED      CREATED BY                                     SIZE        COMMENT
7a80323521cc  2 weeks ago  /bin/sh -c #(nop)  CMD ["sh"]                  0 B         
<missing>     2 weeks ago  /bin/sh -c #(nop) ADD file:03ed8a1a0e4c803...  1.46 MB     
[root@167 ~]# 

tree

//以树格式打印镜像的图层层次结构

[root@167 ~]# podman image tree httpd
Image ID: f2a976f932ec
Tags:     [docker.io/library/httpd:latest]
Size:     149.4MB
Image Layers
├── ID: 92a4e8a3140f Size: 83.87MB
├── ID: a4e4bf34672a Size: 3.072kB
├── ID: bd5bab5c0d10 Size: 5.103MB
├── ID: bfc56aacd784 Size: 60.45MB
└── ID: 3e7a25c44091 Size: 3.584kB Top Layer of: [docker.io/library/httpd:latest]

[root@167 ~]# 

container容器管理子命令

create

//创建一个或多个容器

[root@167 ~]# podman container create httpd
5f21284b39c5c9e0ce05b70e5a63fe11e06ef3e07b59b2d4478cdd399dc2fd27
[root@167 ~]# podman container create --name test httpd
54534b1d5f6bbd03a3dcdf974570423304012abea045d526531779f82f129593
[root@167 ~]# 

start

//启动一个或多个容器

[root@167 ~]# podman container start 5f21284b39c test
5f21284b39c
test
[root@167 ~]# 
[root@167 ~]# podman ps
CONTAINER ID  IMAGE                           COMMAND           CREATED             STATUS             PORTS       NAMES
5f21284b39c5  docker.io/library/httpd:latest  httpd-foreground  2 minutes ago       Up 18 seconds ago              ecstatic_bassi
54534b1d5f6b  docker.io/library/httpd:latest  httpd-foreground  About a minute ago  Up 18 seconds ago              test
[root@167 ~]# 

ps或者list

//容器列表

[root@167 ~]# podman container list
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS                 PORTS       NAMES
5f21284b39c5  docker.io/library/httpd:latest  httpd-foreground  3 minutes ago  Up About a minute ago              ecstatic_bassi
54534b1d5f6b  docker.io/library/httpd:latest  httpd-foreground  2 minutes ago  Up About a minute ago              test
[root@167 ~]# podman container ps
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS                 PORTS       NAMES
5f21284b39c5  docker.io/library/httpd:latest  httpd-foreground  3 minutes ago  Up About a minute ago              ecstatic_bassi
54534b1d5f6b  docker.io/library/httpd:latest  httpd-foreground  2 minutes ago  Up About a minute ago              test
[root@167 ~]# 

rename

//重命名现有容器

[root@167 ~]# podman container rename test web
[root@167 ~]# podman container list
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS            PORTS       NAMES
5f21284b39c5  docker.io/library/httpd:latest  httpd-foreground  4 minutes ago  Up 2 minutes ago              ecstatic_bassi
54534b1d5f6b  docker.io/library/httpd:latest  httpd-foreground  3 minutes ago  Up 2 minutes ago              web
[root@167 ~]# 

stop

//停止一个或多个容器

[root@167 ~]# podman container list
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS            PORTS       NAMES
5f21284b39c5  docker.io/library/httpd:latest  httpd-foreground  4 minutes ago  Up 2 minutes ago              ecstatic_bassi
54534b1d5f6b  docker.io/library/httpd:latest  httpd-foreground  3 minutes ago  Up 2 minutes ago              web
[root@167 ~]# podman stop ecstatic_bassi web 
ecstatic_bassi
web
[root@167 ~]# podman container list
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
[root@167 ~]# 

run

//在新容器中运行命令(可以理解为创建并启动容器)

[root@167 ~]# podman container run -itd --name test httpd
3d44901664493f88262ebf1862697923ffa011769b5cfa367fc69fd6456f11d7
[root@167 ~]# podman container list
CONTAINER ID  IMAGE                           COMMAND           CREATED        STATUS            PORTS       NAMES
3d4490166449  docker.io/library/httpd:latest  httpd-foreground  3 seconds ago  Up 3 seconds ago              test
[root@167 ~]# 

参数说明:
    -a stdin: 指定标准输入输出内容类型,可选 STDIN/STDOUT/STDERR 三项;
    -d: 后台运行容器,并返回容器ID;
    -i: 以交互模式运行容器,通常与 -t 同时使用;
    -t: 为容器重新分配一个伪输入终端,通常与 -i 同时使用;
    -P: 随机端口映射,容器内部端口随机映射到主机的端口
    -p: 指定端口映射,格式为:主机(宿主)端口:容器端口
    --name="nginx-lb": 为容器指定一个名称;
    --dns 8.8.8.8: 指定容器使用的DNS服务器,默认和宿主一致;
    --dns-search example.com: 指定容器DNS搜索域名,默认和宿主一致;
    -h "mars": 指定容器的hostname;
    -e username="ritchie": 设置环境变量;
    --env-file=[]: 从指定文件读入环境变量;
    --cpuset="0-2" or --cpuset="0,1,2": 绑定容器到指定CPU运行;
    -m :设置容器使用内存最大值;
    --net="bridge": 指定容器的网络连接类型,支持 bridge/host/none/container: 四种类型;
    --link=[]: 添加链接到另一个容器;
    --expose=[]: 开放一个端口或一组端口;
    --volume , -v: 绑定一个卷
    	绑定挂载卷: -v 宿主机目录:容器目录		//目录可以事先不存在,在启动容器时自动生成
    	容器管理卷: -v 容器目录				   //只需指定容器的目录,宿主机的挂载点由docker引擎自行生成
    --volumes-from: 在新容器当中挂载已存在的容器的卷
    	--volumes-from 要挂载的容器名
    --restart always: 让容器保持运行状态

attach

//连接到运行的容器

[root@167 ~]# podman container attach xixi 
/ # ls
bin   dev   etc   home  proc  root  run   sys   tmp   usr   var
/ # 

exec

//在正在运行的容器中运行进程

[root@167 ~]# podman container exec -it xixi /bin/sh
/ # ls
bin   dev   etc   home  proc  root  run   sys   tmp   usr   var
/ # 

cp

//在容器和本地文件之间复制文件/文件夹

[root@167 ~]# podman container run -itd --name xixi busybox
7b6fe6ab99e607111ec3a04bfbb5e5073a0b2179942a89327bc532ea34149ebb
[root@167 ~]# podman container cp abc xixi:/
[root@167 ~]# podman container exec -it xixi /bin/sh
/ # ls
abc   bin   dev   etc   home  proc  root  run   sys   tmp   usr   var
/ # 

diff

//检查对容器文件系统的更改

[root@167 ~]# podman container diff xixi 
A /abc
C /etc
C /root
A /root/.ash_history
[root@167 ~]# 

inspect

//显示容器的配置

[root@167 ~]# podman container inspect xixi 
[
     {
          "Id": "7b6fe6ab99e607111ec3a04bfbb5e5073a0b2179942a89327bc532ea34149ebb",
          "Created": "2022-08-15T11:26:23.932222583+08:00",
          "Path": "sh",
          "Args": [
               "sh"
          ],
.................
               "CpuCount": 0,
               "CpuPercent": 0,
               "IOMaximumIOps": 0,
               "IOMaximumBandwidth": 0,
               "CgroupConf": null
          }
     }
]

stats

//显示容器使用资源的状态

[root@167 ~]# podman container stats xixi 

ID            NAME        CPU %       MEM USAGE / LIMIT  MEM %       NET IO          BLOCK IO    PIDS        CPU TIME     AVG CPU %
7b6fe6ab99e6  xixi        2.56%       274.4kB / 815.1MB  0.03%       822B / 1.446kB  -- / --     1           42.480468ms  2.56%

top

//显示容器的运行进程

[root@167 ~]# podman container top xixi 
USER        PID         PPID        %CPU        ELAPSED         TTY         TIME        COMMAND
root        1           0           0.000       4m13.35729974s  pts/0       0s          sh 
[root@167 ~]# 

logs

//获取一个或多个容器的日志

[root@167 ~]# podman container logs xixi

kill

//使用特定信号终止一个或多个正在运行的容器

[root@167 ~]# podman kill xixi 
xixi
[root@167 ~]# podman ps
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
[root@167 ~]# 

port

列出端口映射或容器的特定映射

[root@167 ~]# podman container run -d --name test1 -p 666:80 httpd
688c3b85fa3beb4631bc66d04cabc60ab5e5db9a3e61db42d7100dd085f2696e
[root@167 ~]# podman container port test1
80/tcp -> 0.0.0.0:666
[root@167 ~]# 

kill

//使用特定信号终止一个或多个正在运行的容器

[root@167 ~]# podman kill xixi 
xixi
[root@167 ~]# podman ps
CONTAINER ID  IMAGE       COMMAND     CREATED     STATUS      PORTS       NAMES
[root@167 ~]# 

port

列出端口映射或容器的特定映射

[root@167 ~]# podman container run -d --name test1 -p 666:80 httpd
688c3b85fa3beb4631bc66d04cabc60ab5e5db9a3e61db42d7100dd085f2696e
[root@167 ~]# podman container port test1
80/tcp -> 0.0.0.0:666
[root@167 ~]# 

使用 Podman 签署和分发容器镜像

[root@167 ~]# gpg --full-gen-key
gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
  (14) Existing key from card
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 
Requested keysize is 2048 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 
Key does not expire at all
Is this correct? (y/N) y

GnuPG needs to construct a user ID to identify your key.

Real name: 1@2.com
Name may not start with a digit
Real name: test
Name must be at least 5 characters long
Real name: alg
Name must be at least 5 characters long
Real name: zhanwanli
Email address: 1@2.com
Comment: stet
You selected this USER-ID:
    "zhanwanli (stet) <1@2.com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 434AE86BF529A06E marked as ultimately trusted
gpg: directory '/root/.gnupg/openpgp-revocs.d' created
gpg: revocation certificate stored as '/root/.gnupg/openpgp-revocs.d/1EC00FB9F61CB21986907AA2434AE86BF529A06E.rev'
public and secret key created and signed.

pub   rsa2048 2022-08-16 [SC]
      1EC00FB9F61CB21986907AA2434AE86BF529A06E
uid                      zhanwanli (stet) <1@2.com>
sub   rsa2048 2022-08-16 [E]

[root@167 ~]# gpg --list-keys 1@2.com
gpg: checking the trustdb
gpg: marginals needed: 3  completes needed: 1  trust model: pgp
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
pub   rsa2048 2022-08-16 [SC]
      1EC00FB9F61CB21986907AA2434AE86BF529A06E
uid           [ultimate] zhanwanli (stet) <1@2.com>
sub   rsa2048 2022-08-16 [E]

[root@167 ~]# 
[root@167 ~]# podman pull docker://docker.io/alpine:latest
Trying to pull docker.io/library/alpine:latest...
Getting image source signatures
Copying blob 213ec9aee27d done  
Copying config 9c6f072447 done  
Writing manifest to image destination
Storing signatures
9c6f0724472873bb50a2ae67a9e7adcb57673a183cea8b06eb778dca859181b5
[root@167 ~]# 
[root@podman ~]# podman tag alpine 192.168.159.167/alpine:v0.1
[root@podman ~]# podman images 
REPOSITORY                TAG         IMAGE ID      CREATED       SIZE
docker.io/library/alpine  latest      c059bfaa849c  8 months ago  5.87 MB
192.168.159.167/alpine    v0.1        c059bfaa849c  8 months ago  5.87 MB
[root@podman ~]# 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值