podman的安装及加速器的配置

1、podman与docker类似

在centos8上podman是默认的

yum install podman -y

2、镜像加速器配置

cd /etc/containers/
mv registries.conf registries.conf_bak

cat registries.conf

unqualified-search-registries = ["docker.io"]
[[registry]]
prefix = "docker.io"
location = "阿里加速地址或是其他加速地址" (不用加https://  直接加地址)


 

Podman是一款轻量级的容器管理工具,类似于Docker,但它不需要运行守护进程。如果你想要配置Podman来加速镜像下载,可以按照以下步骤操作: 1. **安装配置HTTP代理**: 如果你的网络环境支持HTTP代理,首先需要设置环境变量`http_proxy`、`https_proxy` 和 `no_proxy`,例如: ``` export http_proxy=http://your-proxy-url:port export https_proxy=https://your-proxy-url:port no_proxy=localhost,127.0.0.1,domain-you-do-not-want-to-proxy.com ``` 2. **启用镜像仓库加速**: Podman支持从registries.io (以前称为quay.io) 加速私有Registry的访问。你可以通过添加`--registry-mirror` 或 `--insecure-registries` 标志来指定镜像源。例如,如果想使用registries.io作为镜像加速器: ``` podman pull --registry-mirror=https://cdn.registries.docker.io myregistry/myimage:latest ``` 或者对特定私有Registry加不安全标志以绕过TLS检查: ``` podman pull --insecure-registries=myprivate.registry.com myimage:latest ``` 3. **更新缓存**: 下载完成后,Podman会将镜像存储到本地,下次直接从缓存拉取会更快。你可以清理旧的镜像缓存来释放空间: ``` podman system prune -a --all --volumes ``` 4. **配置默认行为**: 如果你想让所有的Podman操作都自动使用加速,可以在~/.config/podman/config.yaml文件中添加相应的配置: ```yaml registries: "myregistry.com": endpoint: "https://cdn.registries.docker.io" ``` 记得替换上述示例中的URL和域名为你实际使用的镜像仓库信息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值