docker - k3d 拉取镜像失败 "docker.io/rancher/pause:3.1"

标签 docker kubernetes k3s

我用 k3d create && k3d start 开始了 k3d .

所有 pod 都无法启动,并出现以下错误:

Warning FailedCreatePodSandBox 14s (x2 over 31s) kubelet, k3d-k3s-default-server Failed to create pod sandbox: rpc error: code = Unknown desc = failed to get sandbox image "docker.io/rancher/pause:3.1": failed to pull image "docker.io/rancher/pause:3.1": failed to pull and unpack image "docker.io/rancher/pause:3.1": failed to resolve reference "docker.io/rancher/pause:3.1": failed to do request: Head https://registry-1.docker.io/v2/rancher/pause/manifests/3.1: dial tcp: lookup registry-1.docker.io: Try again



recommended by a k3d contributor ,我已经执行到 k3d 服务器容器并尝试手动拉取图像:
$ docker exec -it k3d-k3s-default-server sh
/ # ctr image pull docker.io/rancher/pause:3.1
docker.io/rancher/pause:3.1: resolving      |--------------------------------------|
elapsed: 4.9 s               total:   0.0 B (0.0 B/s)
ctr: failed to resolve reference "docker.io/rancher/pause:3.1": failed to do request: Head https://registry-1.docker.io/v2/rancher/pause/manifests/3.1: dial tcp: lookup registry-1.docker.io: Try again

在宿主环境中,docker pull docker.io/rancher/pause:3.1工作得很好。

我看到很多人通过调整各种 DNS 设置来解决这个问题。但没有人描述他们是如何找到他们的特定解决方案的。

解决这个问题会让我高兴。发现一个通用的诊断策略会让我更快乐。

什么没有奏效

来自 here :

I got the issue. I had one entry in /etc/systemd/network/en0.networking Deleted that file, and everything is fine.



我在 /etc/systemd/network/ 中没有文件.

最佳答案

我遇到了同样的问题,k3s 无法拉取图像并通过更新我的 /etc/resolv.conf 解决了这个问题。来自 /run/systemd/resolve/stub-resolv.conf 的符号链接(symbolic link)在主机上

ln -sf /etc/resolv.conf /run/systemd/resolve/stub-resolv.conf

关于docker - k3d 拉取镜像失败 "docker.io/rancher/pause:3.1",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61325361/

相关文章:

node.js - 无法构建docker镜像

kubernetes - status.lastScheduleTime 何时更改?

postgresql - Docker Postgresql 错误提示 : The server must be started by the user that owns the data directory postgresql rhel

docker - kubelet-Docker容器通信如何发生?

typescript - Pulumi 在运行时获取 kubernetes 上下文

kubernetes - 如何更改/设置 k8s 主节点内部 IP 或公共(public) IP?

kubernetes - k3s ctr 图像导入到不同的目录

kubernetes - 是否可以通过 Kubernetes Controller 节点提供应用程序?

linux - Docker托管环境的ContentRootPath

kubernetes - 如何使用每个节点运行一个Pod并使用所有可用资源的Pod在Kubernetes(GKE)上自动缩放?