设为首页 加入收藏

TOP

docker镜像仓库hub.docker.com无法访问-解决办法(一)
2023-09-23 15:44:27 】 浏览:230
Tags:docker hub.docker.com 解决办

docker镜像仓库hub.docker.com无法访问-解决办法

文章主要内容:

  • 个人镜像站点

  • dockerhub为什么无法访问

  • 镜像加速

1 个人镜像站点

话不多说,直接上dockerhub个人镜像站点(每天限制10w访问,只要不被封,一直免费提供访问

hub.axlinux.top

速度非常快,无需魔法可以直接访问

可以进行镜像搜索

也可以查看镜像版本号

2 dockerhub为什么无法访问

最近许多群友都询问为什么无法访问Docker镜像仓库,于是我也尝试去访问,结果果然无法访问。

大家的第一反应就是给墙了,通过ping检测红的很可怕。

实际上是DNS被污染了,导致很多用户都无法访问。至于什么是DNS污染,大家可以自行查询,这里主要讲解怎么解决dockerhub无法访问的问题。

如果仅仅是dns污染,我们可以手动指定hosts文件进行访问,但是实际的ip根本访问不通。

2.1 查看dockerhub实际IP

3.228.146.75
18.210.197.188
18.206.20.10

2.2 ping检测

全部丢包,无法访问

[root@waluna ~]# ping -c1 3.228.146.75
PING 3.228.146.75 (3.228.146.75) 56(84) bytes of data.

--- 3.228.146.75 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

[root@waluna ~]# ping -c1 18.210.197.188
PING 18.210.197.188 (18.210.197.188) 56(84) bytes of data.

--- 18.210.197.188 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

[root@waluna ~]# ping -c1 18.206.20.10
PING 18.206.20.10 (18.206.20.10) 56(84) bytes of data.

--- 18.206.20.10 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0ms

[root@waluna ~]# 

3 镜像加速

3.1 使用国内镜像加速

常见的国内加速服务:

废话不多说,直接上命令

3.1.1 docker配置:

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["镜像加速地址"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

# 示例
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://eph8xfli.mirror.aliyuncs.com"]	# 这是博主自己的阿里云镜像加速地址,大家可以更换为自己的
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker

阿里云官网也有不同操作系统的操作文档,大家可以自行查阅

https://help.aliyun.com/document_detail/60750.html?spm=a2c4g.348824.0.0.742fa42dEeTNYo

3.1.2 containerd配置:

包括K8S镜像加速

vim /etc/containerd/config.toml
      [plugins."io.containerd.grpc.v1.cri".registry.mirrors]

        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
          endpoint = ["https://docker.mirrors.ustc.edu.cn","http://hub-mirror.c.163.com"]
        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."gcr.io"]
          endpoint = ["https://gcr.mirrors.ustc.edu.cn"]
        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."k8s.gcr.io"]
          endpoint = ["https://gcr.mirrors.ustc.edu.cn/google-containers/"]
        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."quay.io"]
          endpoint = ["https://quay.mirrors.ustc.edu.cn"]
        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."ghcr.io"]
          endpoint = ["https://ghcr.dockerproxy.com"]

3.2 使用博主个人镜像仓库

本镜像仓库在阿里云,主要包含K8S相关镜像。如果大家有所需求,可以联系博主增加相关镜像。

镜像每天持续同步更新,目前有80+仓库,包含新版和常用镜像版本。

3.2.1 目前有如下镜像仓库,后续会陆续增加

  docker.elastic.co:
    - elasticsearc
首页 上一页 1 2 下一页 尾页 1/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇openSTLinux系统如何配置开机启动.. 下一篇零拷贝技术:减少数据复制和上下..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目