初学容器镜像Podman

一、查找并管理容器镜像

1、显示容器注册表配置文件

cat /home/student/.config/containers/registries.conf 
unqualified-search-registries = ['registry.lab.example.com']
 
[[registry]]
location = "registry.lab.example.com"
insecure = true
blocked = false

2、使用podman search 查找,例子:在注册表中搜索名称以“ubi”开头的镜像

podman search registry.lab.example.com/ubi
INDEX         NAME                                DESCRIPTION   STARS   OFFICIAL   AUTOMATED
example.com   registry.lab.example.com/ubi7/ubi                 0                  
example.com   registry.lab.example.com/ubi8/ubi                 0                

3、使用podman login 命令登录容器注册表,可以使用podman --help查看帮助,--useradmin 直接带用户名。

podman login registry.lab.example.com   --username admin --password redhat321
WARNING! Using --password via the cli is insecure. Please consider using --password-stdin
Login Succeeded!

4、提取镜像:podman pull,从注册表中提取容器镜像。

podman  pull registry.lab.example.com/rhel8/httpd-24
Trying to pull registry.lab.example.com/rhel8/httpd-24...
Getting image source signatures
Copying blob 9d20433efa0c skipped: already exists  
Copying blob 77c58f19bd6e skipped: already exists  
Copying blob 47db82df7f3f skipped: already exists  
Copying config 7e93f25a94 done  
Writing manifest to image destination
Storing signatures
7e93f25a946892c9c175b74a0915c96469e3b4845a6da9f214fd3ec19c3d7070
   已上为已经安装过,再执行了,所以报已存在了。

5、查看镜像:podman image,查看本地存储镜像。下图是上面提取完的镜像。

podman  images  
REPOSITORY                                TAG      IMAGE ID       CREATED         SIZE
registry.lab.example.com/rhel8/httpd-24   latest   7e93f25a9468   22 months ago   430 MB

6、删除镜像:podman rmi移除本地存储的镜像

podman  rmi  registry.lab.example.com/rhel8/httpd-24:latest 
Untagged: registry.lab.example.com/rhel8/httpd-24:latest
Deleted: 7e93f25a946892c9c175b74a0915c96469e3b4845a6da9f214fd3ec19c3d7070


再次查看:显示为空
podman images 
REPOSITORY   TAG   IMAGE ID   CREATED   SIZE

已上为podmon增删改查的基本操作。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值