RHEL8安装podman

podman最低系统版本要求RHEL8.2
RHEL8.0的podman版本是1.4或1.6,不建议使用
推荐使用RHEL-Stream,该版本默认安装podman
podman不再要求root权限,podman无守护进程,安装完即用,不需要开启服务.

安装podman

# 安装podman
yum -y install podman

# 查看podman版本
[rhel8 root ~]# podman --version
podman version 3.0.2-dev

podman无守护进程,安装完即用,不需要开启服务.


配置podman镜像加速

podman的默认配置文件/etc/containers/registries.conf

[rhel8 root ~]# ls /etc/containers/registries.conf
/etc/containers/registries.conf

备份主配置文件

[rhel8 root /etc/containers]# mv registries.conf registries.conf.bak

# 新建一个空主配置文件
touch registries.conf 

取消辅助配置文件

# 备份registries.conf.d目录,使辅助配置文件不再生效
mv registries.conf.d registries.conf.d.bak

填写配置

填写配置文件,写在文件最下方,或者备份源文件,新建一个空文件,写入配置.
可以自行去https://cr.console.aliyun.com/查看自己的镜像加速地址

# 从哪里拉取一个不合规的镜像,也就是镜像的前缀,从docker.io拉取镜像
unqualified-search-registries = ["docker.io"]
# 从location的地址中拉取docker.io的镜像
[[registry]]
# 匹配哪个地址,触发location
prefix = "docker.io"
# 此处的url不能有http前缀
location = "isdp30x2.mirror.aliyuncs.com"

测试拉取镜像

[rhel8 root ~]# podman pull hello-world
Resolving "hello-world" using unqualified-search registries (/etc/containers/registries.conf)
Trying to pull docker.io/library/hello-world:latest...
Getting image source signatures
Copying blob 2db29710123e done  
Copying config feb5d9fea6 done  
Writing manifest to image destination
Storing signatures
feb5d9fea6a5e9606aa995e879d862b825965ba48de054caab5ef356dc6b3412

podman配置代理拉取海外镜像

有些情况下,我们生产环境需要拉取海外的镜像源,但是拉取镜像时会超时.这时候需要给podman配置代理.

# 设置临时变量
export https_proxy=127.0.0.1:8118
## 或者直接配置socks5
export https_proxy=socks5://127.0.0.1:10808

# 然后再执行podman pull
podman pull gcr.io/google-containers/ubuntu:14.04

# 用完后取消代理变量
unset https_proxy

# 查看是否取消变量
echo $https_proxy
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

识途老码

赞赏是第一生产力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值