Rancher Server 设置
- Rancher 版本:2.12.0
- 安装选项 (Docker install/Helm Chart): Docker install
- 在线或离线部署:在线部署
主机操作系统:
- Centos 7.8 ,内核 3.10,docker版本 26系列
问题描述:
使用Docker部署时,安装失败,查看k3s.log 出现 镜像拉取失败,但是我这边指定了阿里云的镜像地址
重现步骤:
docker run --name rancher -itd --restart=unless-stopped
-p 80:80
-p 443:443
-v /var/log/rancher-auditlog:/var/log/rancher/auditlog
-v /data/rancher:/var/lib/rancher
-e CATTLE_SYSTEM_DEFAULT_REGISTRY=registry.cn-hangzhou.aliyuncs.com
-e CATTLE_AGENT_IMAGE=registry.cn-hangzhou.aliyuncs.com/rancher/rancher-agent:v2.12.0
–privileged
registry.cn-hangzhou.aliyuncs.com/rancher/rancher:v2.12.0
结果:
2025/08/19 04:27:48 [INFO] RDPClient: Checking if dialer is built...
2025/08/19 04:27:48 [INFO] RDPClient: Dialer is not built yet, waiting 5 secs to re-check.
k3s.log
Error syncing pod, skipping" err="failed to \"CreatePodSandbox\" for \"coredns-697968c856-xhmmg_kube-system(e0e7d8c7-c9d9-454d-97a2-3209059e73f9)\" with CreatePodSandboxError: \"Failed to create sandbox for pod \\\"coredns-697968c856-xhmmg_kube-system(e0e7d8c7-c9d9-454d-97a2-3209059e73f9)\\\": rpc error: code = DeadlineExceeded desc = failed to start sandbox \\\"8accf2d675672acf57707556c23795f21c66516ec79c6bf15924297cc2d04a79\\\": failed to get sandbox image \\\"rancher/mirrored-pause:3.6\\\": failed to pull image \\\"rancher/mirrored-pause:3.6\\\": failed to pull and unpack image \\\"docker.io/rancher/mirrored-pause:3.6\\\": failed to resolve reference \\\"docker.io/rancher/mirrored-pause:3.6\\\": failed to do request: Head \\\"https://registry-1.docker.io/v2/rancher/mirrored-pause/manifests/3.6\\\": dial tcp 69.171.234.48:443: i/o timeout\"" pod="kube-system/coredns-697968c856-xhmmg" podUID="e0e7d8c7-c9d9-454d-97a2-3209059e73f9"
预期结果: 镜像使用阿里云仓库
截图: