Aspire开发配置Podman代理
1.查看Windows网络连接中的WSL网卡IP或在podman machine内执行命令得到IP
--进入sshd
podman machine ssh
--执行
cat /etc/resolv.conf
-
使用podman desktop UI配置,在settings - proxy ,Porxy configuration选择Manual,
Web Proxy(HTTP) 和 Secure Web Proxy(https) 都填入自己的代理服务器地址,我使用的是 socks5h://172.27.128.1:10808,代理允许局域网连接。 -
虚拟机内测试
curl https://registry-1.docker.io/v2/ //成功
拉取镜像
podman pull docker.io/library/rabbitmq:4.2 //还是失败
查到多个方法,
在/etc/systemd/system/podman.service.d/http-proxy.conf 创建代理服务配置
在/usr/share/containers/containers.conf 配置全局代理,该配置文件太过复杂 -
在虚拟机创建目录
mkdir -p ~/.config/containers
--创建配置文件
vi ~/.config/containers/containers.conf
--粘贴内容
[engine]
env = [
"HTTP_PROXY=socks5h://172.27.128.1:10808",
"HTTPS_PROXY=socks5h://172.27.128.1:10808",
"NO_PROXY=localhost,127.0.0.1"
]
--重启虚拟机
podman pull docker.io/library/rabbitmq:4.2
拉取镜像,成功。

浙公网安备 33010602011771号