podman删除镜像清理镜像命令和镜像加速

本文详细介绍了如何配置Podman的镜像加速,包括全局和用户单独配置文件的编辑,以及如何添加国内镜像源。同时,也提供了私有仓库的配置方法,无论是HTTP还是HTTPS,并指出了如何在不使用TLS的情况下设置。此外,还列举了Podman的镜像和容器清理命令,如删除悬空镜像、停止状态的容器,以及系统级别的全面清理选项,帮助优化本地Podman环境。
摘要由CSDN通过智能技术生成

podman镜像加速,国内镜像

全局配置文件:vim /etc/containers/registries.conf

用户单独配置文件:vim ~/.config/containers/registries.conf

unqualified-search-registries = ["docker.io", "quay.io","registry.access.redhat.com"]

[[registry]]
prefix = "docker.io"
location = "docker.io"

[[registry]]
prefix = "k8s.gcr.io"
location = "registry.aliyuncs.com/google_containers"

[[registry.mirror]]
location = "docker.mirrors.ustc.edu.cn"
[[registry.mirror]]
location = "registry.docker-cn.com"

[[registry]]
prefix = "quay.io"
location = "quay.azk8s.cn"

unqualified-search-registries 按照顺序去获取

私有镜像仓库配置 http

例如,私有仓库是 http://hub.foxwho.com:5000
如下私有镜像仓库

[[registry]]
prefix = "hub.foxwho.com:5000"
location = "hub.foxwho.com:5000"
insecure = true

私有仓库地址去掉http,并设置不使用TLS参数 insecure = true

私有镜像仓库配置 https

例如,私有仓库是 https://hub.foxwho.com:5000
如下私有镜像仓库

[[registry]]
prefix = "hub.foxwho.com:5000"
location = "hub.foxwho.com:5000"

删除无用镜像

删除 dangling 镜像(悬空)

podman image prune

删除 dangling 镜像包括没有被实例运行的引用

podman image prune -a

删除无用实例,删除stopped 停止状态

podman container prune

清理系统

删除悬空镜像,停止状态,构建过程中的缓存

podman system prune

删除悬空镜像,停止状态,构建过程中的缓存,包括不再被容器实例引用的数据卷

podman system prune --volumes

清理没有被运行实例引用的镜像

podman system prune -a

彻底清理

删除包含数据卷在内的所有数据

podman system prune -a --volumes
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

风.foxwho

你的鼓励将是我创作的最大动力

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

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

打赏作者

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

抵扣说明:

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

余额充值