欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 科技 > IT业 > Podman配置

Podman配置

2025/6/28 22:09:29 来源:https://blog.csdn.net/DouMiaoO_Oo/article/details/147066818  浏览:    关键词:Podman配置

因为Docker Desktop 商业化的原因,部分场景可能不能用 Docker 了。简单调研了一下,决定使用 Podman,记录一下 Mac 上安装、配置 Podman 的流程。

正常流程

# 1. 通过 Homebrew 安装 Podman
brew upgrade;
brew install podman;
brew install podman-desktop;# 2. 初始化 Podman 虚拟机
# 创建并启动虚拟机. init只用执行一次
podman machine init;# 3. 启动 Podman 虚拟机
# 每次 `podman machine stop;`后也要执行
podman machine start; # 4. 使用 Podman
podman pull nginx  # 此时可能会发现无法访问 docker hub 的镜像

配置镜像

一般情况下因为无法正常访问 docker hub 的镜像,需要按如下流程配置代理镜像:

### 通过虚拟机修改 mirror 配置,# 进入虚拟机
podman machine ssh podman-machine-default;  # Manage a virtual machine. Virtual machines are used to run Podman.# 修改配置
vi ~/.config/containers/registries.conf

输入下列配置:

unqualified-search-registries = ["docker.io"][[registry]]
prefix = "docker.io"
location = "hub-mirror.c.163.com"
insecure = true[[registry.mirror]]
location = "hub-mirror.c.163.com"
insecure = true
[[registry.mirror]]
location = "yum.tbsite.net/mirrors"
insecure = true

保存后输入exit 退出虚拟机管理,再重启一下 Podman 加载配置:

podman machine stop;
podman machine start;

此时再执行podman pull nginx 应该就正常了

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词