完美解決Docker pull時報錯:https://registry-1.docker.io/v2/

1、錯誤描述

root@ubuntu-database:/opt/dify/docker# docker compose up -d
[+] Running 9/9? api Error        context canceled                                                                                                                                                                            15.1s ? db Error         context canceled                                                                                                                                                                            15.1s ? nginx Error      context canceled                                                                                                                                                                            15.1s ? redis Error      Get "https://registry-1.docker.io/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)                                                                          15.1s ? ssrf_proxy Error context canceled                                                                                                                                                                            15.1s ? worker Error     context canceled                                                                                                                                                                            15.1s ? weaviate Error   context canceled                                                                                                                                                                            15.1s ? sandbox Error    context canceled                                                                                                                                                                            15.1s ? web Error        context canceled                                                                                                                                                                            15.1s 
Error response from daemon: Get "https://registry-1.docker.io/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

????????Error response from daemon: Get "https://registry-1.docker.io/v2/": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

????????這個錯誤表明Docker客戶端嘗試訪問Docker Hub或其他Docker注冊中心時出現了問題。具體來說,是在嘗試獲取注冊中心API的響應時遇到了錯誤。可能的原因包括網絡問題、認證問題、注冊中心URL不正確或者注冊中心服務本身不可用。

2、解決方法

2.1、檢查網絡連接

????????確保你的機器可以訪問互聯網,特別是Docker Hub或你所使用的私有注冊中心。????????

root@ubuntu-database:/opt/dify/docker# ping www.baidu.com
PING www.a.shifen.com (110.242.68.3) 56(84) bytes of data.
64 bytes from 110.242.68.3: icmp_seq=1 ttl=128 time=38.5 ms
64 bytes from 110.242.68.3: icmp_seq=2 ttl=128 time=36.4 ms
64 bytes from 110.242.68.3: icmp_seq=3 ttl=128 time=52.3 ms

2.2、檢查Docker服務狀態

????????運行systemctl status docker(Linux系統)查看Docker服務是否正在運行。

root@ubuntu-database:/opt/dify/docker# systemctl status docker
● docker.service - Docker Application Container EngineLoaded: loaded (/usr/lib/systemd/system/docker.service; enabled; preset: enabled)Active: active (running) since Wed 2024-11-27 12:04:05 UTC; 55min ago
TriggeredBy: ● docker.socketDocs: https://docs.docker.comMain PID: 4766 (dockerd)Tasks: 10Memory: 21.8M (peak: 24.5M)CPU: 479msCGroup: /system.slice/docker.service

如以上都沒有問題,下面考慮docker換源

2.3、換源

sudo mkdir -p /etc/docker
vim /etc/docker/daemon.json  

首先進入/etc/docker/daemon.json文件

然后在里面加入下面的配置

{"registry-mirrors" : ["https://docker.registry.cyou",
"https://docker-cf.registry.cyou",
"https://dockercf.jsdelivr.fyi",
"https://docker.jsdelivr.fyi",
"https://dockertest.jsdelivr.fyi",
"https://mirror.aliyuncs.com",
"https://dockerproxy.com",
"https://mirror.baidubce.com",
"https://docker.m.daocloud.io",
"https://docker.nju.edu.cn",
"https://docker.mirrors.sjtug.sjtu.edu.cn",
"https://docker.mirrors.ustc.edu.cn",
"https://mirror.iscas.ac.cn",
"https://docker.rainbond.cc",
"https://do.nark.eu.org",
"https://dc.j8.work",
"https://dockerproxy.com",
"https://gst6rzl9.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"http://mirrors.ustc.edu.cn/",
"https://mirrors.tuna.tsinghua.edu.cn/",
"http://mirrors.sohu.com/" 
],"insecure-registries" : ["registry.docker-cn.com","docker.mirrors.ustc.edu.cn"],
"debug": true,
"experimental": false
}

重載生效

sudo systemctl daemon-reload

重啟服務

sudo systemctl restart docker

查看是否配置成功

docker info
root@ubuntu-database:/etc/docker# docker info
Client: Docker Engine - CommunityVersion:    27.3.1Context:    defaultDebug Mode: falsePlugins:buildx: Docker Buildx (Docker Inc.)Version:  v0.17.1Path:     /usr/libexec/docker/cli-plugins/docker-buildxcompose: Docker Compose (Docker Inc.)Version:  v2.29.7Path:     /usr/libexec/docker/cli-plugins/docker-composeServer:Containers: 0Running: 0Paused: 0Stopped: 0Images: 0Server Version: 27.3.1Storage Driver: overlay2Backing Filesystem: extfsSupports d_type: trueUsing metacopy: falseNative Overlay Diff: trueuserxattr: falseLogging Driver: json-fileCgroup Driver: systemdCgroup Version: 2Plugins:Volume: localNetwork: bridge host ipvlan macvlan null overlayLog: awslogs fluentd gcplogs gelf journald json-file local splunk syslogSwarm: inactiveRuntimes: io.containerd.runc.v2 runcDefault Runtime: runcInit Binary: docker-initcontainerd version: 57f17b0a6295a39009d861b89e3b3b87b005ca27runc version: v1.1.14-0-g2c9f560init version: de40ad0Security Options:apparmorseccompProfile: builtincgroupnsKernel Version: 6.8.0-49-genericOperating System: Ubuntu 24.04 LTSOSType: linuxArchitecture: x86_64CPUs: 4Total Memory: 7.709GiBName: ubuntu-databaseID: acb5a888-7140-4e43-8924-6fc325481944Docker Root Dir: /var/lib/dockerDebug Mode: trueFile Descriptors: 23Goroutines: 40System Time: 2024-11-27T13:09:10.861401847ZEventsListeners: 0Experimental: falseInsecure Registries:docker.mirrors.ustc.edu.cnregistry.docker-cn.com127.0.0.0/8Registry Mirrors:https://docker.registry.cyou/https://docker-cf.registry.cyou/https://dockercf.jsdelivr.fyi/https://docker.jsdelivr.fyi/https://dockertest.jsdelivr.fyi/https://mirror.aliyuncs.com/https://dockerproxy.com/https://mirror.baidubce.com/https://docker.m.daocloud.io/https://docker.nju.edu.cn/https://docker.mirrors.sjtug.sjtu.edu.cn/https://docker.mirrors.ustc.edu.cn/https://mirror.iscas.ac.cn/https://docker.rainbond.cc/https://do.nark.eu.org/https://dc.j8.work/https://gst6rzl9.mirror.aliyuncs.com/https://registry.docker-cn.com/http://hub-mirror.c.163.com/http://mirrors.ustc.edu.cn/https://mirrors.tuna.tsinghua.edu.cn/http://mirrors.sohu.com/Live Restore Enabled: falseWARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

重新執行 :docker compose up -d

出現以下情況,說明問題已解決,如下圖:

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/917781.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/917781.shtml
英文地址,請注明出處:http://en.pswp.cn/news/917781.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

用 Python 批量處理 Excel:從重復值清洗到數據可視化

引言日常工作中,經常需要處理多份 Excel 表格:比如合并銷售數據、清洗重復的用戶信息,最后生成可視化圖表。手動操作不僅效率低,還容易出錯。這篇文章分享一套 Python 自動化流程,用pandas和matplotlib搞定從數據清洗到…

4.5 點云表達方式——圖

(一)定義與原理 圖4-5-1 點云圖結構

wordpress菜單調用的幾種常見形式

在WordPress主題開發里,“菜單”在前端頁面中常見的調用/輸出形式可以歸納為5種,按出現頻率從高到低列給你,并給出最簡代碼片段,方便直接復制粘貼。 標準菜單位置調用(99%場景) 后臺“外觀→菜單”里把菜單A指派到菜單位置prima…

linux中pthread_t 的值與top -Hp中線程id值的區別

linux中pthread_t 值與top -Hp中線程id值的區別 #include <stdio.h> #include <pthread.h> #include <thread>void thread_func() {printf("child thread id0x%x\n",pthread_self());while(1){ printf("hello world\n");} }int ma…

Idea集成Jenkins Control插件,在IDEA中觸發Jenkins中項目的構建

IDEA可以下一個這個插件 Jenkins Control&#xff0c;直接在idea中觸發測試環境項目的部署測試環境API-TOKEN&#xff1a;XXXXXXXXXXXXXXXX&#xff08;在jenkins的首頁 - 系統管理 - 管理用戶中獲取&#xff09;配置號后&#xff0c;測試連接&#xff0c;需要是成功的狀態&…

【ARM】CMSIS6 介紹

1、 簡介CMSIS是通用微控制器軟件接口標準(Common Microcontroller Software Interface Standard ) 的簡寫。CMSIS 包括API、軟件組件、工具及工作流程&#xff0c;主要用于簡化軟件重用、縮短開發人員學習曲線&#xff0c;加快項目構建和調試&#xff0c;從而使產品更快上市。…

【含文檔+PPT+源碼】基于SSM的旅游與自然保護平臺開發與實現

項目介紹 本課程演示的是一款&#xff1f;&#xff1f;&#xff0c;主要針對計算機相關專業的正在做畢設的學生與需要項目實戰練習的 Java 學習者。 包含&#xff1a;項目源碼、項目文檔、數據庫腳本、軟件工具等所有資料 帶你從零開始部署運行本套系統 該項目附帶的源碼資料…

QT6 源,十章繪圖(2)畫刷 QBrush:刷子只涉及填充顏色,線型,填充圖片,以及變換矩陣這幾個屬性,附源代碼帶注釋。

&#xff08;1&#xff09;本類的繼承關系如下 &#xff1a;&#xff08;2&#xff09;本類是支持流運算的 &#xff1a;&#xff08;3&#xff09;本類的構造函數與運算符 operator 函數 &#xff1a;關于本類的構造函數&#xff0c;進行以下測試 &#xff1a;只修改畫刷的構…

安科瑞智慧能源管理系統在啤酒廠5MW分布式光伏防逆流控制實踐

項目信息 光伏裝機1MW&#xff0c;3個并網點&#xff0c;低壓接 入配電系統。 要求自發自用、余電不上網。解決方案 通過防逆流保護裝置&#xff0c;做到剛性控制&#xff0c; 實現并網柜快速切斷&#xff1b;通過防逆流管理系統&#xff0c;做到柔性調節&#xff0c; 實現光伏…

VUE-第二季-02

3.Vue組件化 3.1 什么是組件 (1) 傳統方式開發的應用 一個網頁通常包括三部分&#xff1a;結構&#xff08;HTML&#xff09;、樣式&#xff08;CSS&#xff09;、交互&#xff08;JavaScript&#xff09; 傳統應用存在的問題&#xff1a; ① 關系縱橫交織&#xff0c;復雜…

【OpenGL】LearnOpenGL學習筆記02 - 繪制三角形、矩形

上接: https://blog.csdn.net/weixin_44506615/article/details/149861824 完整代碼&#xff1a;https://gitee.com/Duo1J/learn-open-gl 一、渲染管線 在開始之前&#xff0c;我們先簡單了解一下圖形渲染管線 在渲染3D物體時&#xff0c;我們常用到的一種幾何結構為網格模型…

Mysql的事務是什么?

簡單來說&#xff0c;MySQL 實現事務的核心就像是給你的數據庫操作加了一套“保險和存檔”機制。它確保了你的操作要么全部成功&#xff0c;要么全部失敗&#xff0c;并且在面對多人同時操作、系統突然崩潰等情況時&#xff0c;數據依然可靠、準確。 為什么需要事務呢&#xff…

測試開發:Python+Django實現接口測試工具

【測試開發天花板】DjangoVuePyTest打造企業級自動化平臺&#xff5c;能寫進簡歷的硬核項目最近被幾個公司實習生整自閉了&#xff0c;沒有基礎&#xff0c;想學自動化又不知道怎么去學&#xff0c;沒有方向沒有頭緒&#xff0c;說白了其實就是學習過程中沒有成就感&#xff0c…

TFS-2022《A Novel Data-Driven Approach to Autonomous Fuzzy Clustering》

核心思想 這篇論文的核心思想是提出一種全新的、數據驅動的自主模糊聚類&#xff08;Autonomous Fuzzy Clustering, AFC&#xff09;算法。其核心創新在于&#xff0c;它巧妙地結合了模糊聚類的靈活性和基于中位數&#xff08;medoids&#xff09;聚類的可解釋性&#xff0c;并…

ELK是什么

ELK 是一個廣受歡迎的開源技術棧&#xff0c;用于實時采集、處理、存儲、搜索、分析和可視化海量的日志數據&#xff08;log&#xff09;和機器生成的數據&#xff08;machine data&#xff09;&#xff0c;尤其是在 IT 系統監控、應用故障排查、安全分析和業務智能等領域應用廣…

[硬件電路-123]:模擬電路 - 信號處理電路 - 常見的高速運放芯片、典型電路、電路實施注意事項

一、高速運放常見芯片型號及特性高速運放&#xff08;高速運算放大器&#xff09;通常指帶寬&#xff08;GBW&#xff09;超過10MHz、壓擺率&#xff08;SR&#xff09;高于10V/μs的器件&#xff0c;適用于視頻處理、通信系統、高速數據采集等場景。以下是典型芯片及其特性&am…

關于解決WinRiver項目動態XmlElement的序列化與反序列化的問題

關于解決WinRiver項目動態XmlElement的序列化與反序列化的問題 一、WinRiver項目流量匯總XML內容 1.1、索引可變,索引下 XmlElement 元素內容固定 1.2、如何將對象 BottomTrack 的動態內容序列化為 XML ? 1.3、如何將 XML 動態內容反序列化為對象 BottomTrack ? 二、XML 動態…

【力扣 Hot100】 刷題日記

D3 128.最長連續序列 錯解 class Solution {public int longestConsecutive(int[] nums) {Arrays.sort(nums);int maxCnt 0;int cnt 0;for (int i 0; i < nums.length - 1; i) {if(nums[i] ! nums[i 1] - 1){//如果不連續&#xff0c;取cnt與maxCnt較大值&#xff0c…

飛算JavaAI編程插件:以AI之力賦能Java開發,讓編碼效率再升級

你是否希望自己敲代碼的時候總有一位大佬在你背后幫你保駕護航。想象一下&#xff0c;當你對著Java編輯器敲代碼時&#xff0c;身后站了位“隱形大神”——你剛敲出for&#xff0c;它就預判到你要遍歷集合&#xff0c;自動補全帶泛型的循環邏輯&#xff1b;你手滑把equals寫成&…

機器學習通關秘籍|Day 03:決策樹、隨機森林與線性回歸

目錄 一、決策樹 1、概念 2、基于信息增益的決策樹的建立 &#xff08;1&#xff09;信息熵 &#xff08;2&#xff09;信息增益 &#xff08;3&#xff09;信息增益決策樹建立步驟 3、基于基尼指數的決策樹的建立 4、API 二、隨機森林 1、算法原理 2、API 三、線性…