当前位置:首页 > linux运维

docker镜像无法下载的解决方案

14324472932年前 (2024-06-30)linux运维1672

要更换Docker镜像仓库,您需要编辑Docker的配置文件,并将镜像仓库地址更改为您想要使用的地址。以下是在CentOS系统上更换Docker镜像仓库的一般步骤:
1.连接到您的CentOS服务器,并使用文本编辑器(如vi或nano)打开Docker的配置文件/etc/docker/daemon.json。

sudo vi /etc/docker/daemon.json

如果文件不存在,可以创建它并添加以下内容:(注意以下仓库后面会不会失效还不一定)
条件允许的可以自建docker镜像仓库

{
  "registry-mirrors":
   [
     "https://docker.mirrors.sjtug.sjtu.edu.cn",
      "https://docker.m.daocloud.io",
      "https://docker.itelyou.cf",
      "https://noohub.ru",
      "https://docker.fxxk.dedyn.io",
      "https://huecker.io",
      "https://dockerhub.timeweb.cloud",  
      "https://registry.cn-hangzhou.aliyuncs.com"
   ]
}

.保存并关闭文件。然后重新启动Docker服务,使更改生效。


sudo systemctl daemon-reload
sudo systemctl restart docker

扫描二维码推送至手机访问。

版权声明:本文由爱开发博客发布,如需转载请注明出处。

本文链接:https://www.lovekf.cn/?id=27

分享给朋友:

“docker镜像无法下载的解决方案” 的相关文章

aria2配置文件和bt-tracker定期更新脚本

# # https://github.com/P3TERX/aria2.conf # File name:aria2.conf # Description: Awesome Aria2 configuration file # Version: 2021.09.15 # # Copyright (c…

docker 安装

1.卸载旧版docker sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \…

nginx 和frp共存端口转发规则

```bash server { listen 80; listen [::]:80; server_name *.lovekf.cn; location / { proxy_pass http://127.0.0.1:81; proxy_redirect http://$host/ http:/…

使用自定义docker加速地址下载镜像

1.例如加速地址为:https://docker.1ms.run2.配置docker加速地址cat > /etc/docker/daemon.json <<EOF > {"registry-mirrors":&nb…

宝塔shell脚本删除日期生成的目录

#!/bin/bash # 定义要查找的目录路径 TARGET_DIR="/www/xxxxxx/public/tempipg" find "$TARGET_DIR" -type d -mtime +3 | grep -E "${TARGET_DIR}/[0-9]{8}$" | while re…

发表评论

访客

◎欢迎参与讨论,请在这里发表您的看法和观点。