修改完docker-仓库资源地址Error response from daemon: Get https://index.docker.io/v1/pull

[root@zengmg /]# docker pull centos
Error response from daemon: Get https://index.docker.io/v1/pull?q=centos: read tcp 52.200.132.201:443: i/o timeout
环境:Windows10

应用:Docker Desktop (下载地址:https://download.docker.com/win/stable/Docker%20Desktop%20Installer.exe

国内镜像配置:

1.Docker官方国内:https://registry.docker-cn.com
2.七牛云加速器:https://reg-mirror.qiniu.com/
3.网易镜像:http://hub-mirror.c.163.com
4.中科大镜像加速:https://docker.mirrors.ustc.edu.cn
5.阿里云镜像,自行到官网申请(教程:https://help.aliyun.com/document_detail/60750.html

开始也配置了国内镜像,docker search java 是可以搜索到结果的,docker pull java的时候报错

原因可能是镜像失败走了默认镜像,配置DNS为:8.8.8.8,多填写几个备用国内镜像加速即可。

参考官方文档:

NETWORK

You can configure Docker Desktop networking to work on a virtual private network (VPN). Specify a network address translation (NAT) prefix and subnet mask to enable Internet connectivity.

DNS Server: You can configure the DNS server to use dynamic or static IP addressing.

Note: Some users reported problems connecting to Docker Hub on Docker Desktop Stable version. This would manifest as an error when trying to run docker commands that pull images from Docker Hub that are not already downloaded, such as a first time run of docker run hello-world. If you encounter this, reset the DNS server to use the Google DNS fixed address: 8.8.8.8. For more information, see Networking issues in Troubleshooting.

Updating these settings requires a reconfiguration and reboot of the Linux VM.

---大致意思就是,Docker Desktop运行docker pull镜像命令出错不能下载,例如首次运行docker run hello-world,如果遇到此问题,重设置DSN为google的DNS:8.8.8.8   详细参考https://docs.docker.com/docker-for-windows/troubleshoot/#networking-issues

国内镜像配置如下,

{
  "registry-mirrors": [
    "https://yourid_xxx.mirror.aliyuncs.com",
    "https://reg-mirror.qiniu.com/",
    "http://hub-mirror.c.163.com"
  ],
  "insecure-registries": [],
  "debug": true,
  "experimental": false
}
配置DNS
### 解决 Docker 连接被拒绝的问题 当遇到 `Cannot connect to the Docker daemon at unix:///var/run/docker.sock` 的错误提示时,这通常意味着 Docker 守护进程未运行或者客户端无法与其建立连接[^1]。 对于 macOS 用户而言,可以尝试通过重新启动 Docker Desktop 来解决问题。如果问题依旧存在,则可能需要进一步排查其他潜在原因: - **确认守护程序状态**:确保 Docker 服务正在运行。可以通过命令 `sudo systemctl status docker` (适用于 Linux) 或者查看 Docker Desktop 是否正常工作来验证这一点。 - **权限设置**:有时文件 `/var/run/docker.sock` 的访问权限不足也会引发此类报错。此时应当检查该路径下 socket 文件的属性并适当调整其读写权限给当前用户组。 - **环境变量配置**:确保设置了正确的 DOCKER_HOST 环境变量指向本地 Unix Socket 地址 (`unix:///var/run/docker.sock`) 而不是远程主机地址或其他形式的连接字符串。 针对具体场景中的 xxl-job 部署情况,在操作前建议先按照官方文档指导成必要的准备工作,并参照如下步骤处理可能出现的问题: ```bash cd /path/to/xxl-job-docker-repo docker-compose down --remove-orphans # 清理旧容器实例 git pull origin master # 更新项目源码至最新版本 docker-compose build # 构建镜像(如有必要) docker-compose up -d # 启动服务集群 ``` 上述脚本会停止现有容器、同步最新的代码变更以及重启新的容器集以应用更新后的配置[^2]。 #### 关于 Nginx 和 PHP-FPM 在 Docker 中的应用背景介绍部分省略不述,请参阅原文获取更多细节信息[^3]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值