docker配置鏡像Docker pull時報錯:https://registry-1.docker.io/v2/問題
更新時間:2026年01月19日 09:19:22 作者:竹杖芒鞋輕勝馬,誰怕?一蓑煙雨任平生。
Docker拉鏡像報錯的原因可能是網(wǎng)絡問題、認證問題、注冊中心URL不正確或注冊中心服務不可用,解決方法包括重載和重啟Docker服務
docker 拉鏡像報錯
#docker pull centos:latest Error response from daemon: Get "https://registry-1.docker.io/v2/": context deadline exceeded**加粗樣式**
這個錯誤表明Docker客戶端嘗試訪問Docker Hub或其他Docker注冊中心時出現(xiàn)了問題。
具體來說,是在嘗試獲取注冊中心API的響應時遇到了錯誤。可能的原因包括網(wǎng)絡問題、認證問題、注冊中心URL不正確或者注冊中心服務本身不可用
解決方法
systemctl status docker sudo mkdir -p /etc/docker vim /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
}
重載和重啟dockers服務
sudo systemctl daemon-reload
sudo systemctl restart docker
# docker info
Client: Docker Engine - Community
Version: 26.1.3
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.14.0
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.27.0
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
說明執(zhí)行成功
# docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 17eec7bbc9d7: Pull complete Digest: sha256:d4aaab6242e0cace87e2ec17a2ed3d779d18fbfd03042ea58f2995626396a274 Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly.
總結(jié)
以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
如何解決Docker啟動問題docker?is?starting…
這篇文章主要給大家介紹了關(guān)于如何解決Docker啟動問題docker?is?starting…的相關(guān)資料,文中通過圖文將解決的過程介紹的非常詳細,需要的朋友可以參考下2023-10-10
Jenkins Docker靜態(tài)agent節(jié)點的構(gòu)建過程
這篇文章主要介紹了Jenkins Docker靜態(tài)agent節(jié)點的構(gòu)建,靜態(tài)節(jié)點就是通過java -jar這條命令去啟動起來就可以了,本文通過圖文實例相結(jié)合給大家介紹的非常詳細,需要的朋友可以參考下2021-10-10
關(guān)于docker安全之Docker-TLS加密通訊問題
這篇文章主要介紹了docker安全之Docker-TLS加密通訊,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-12-12
Docker?Buildx實現(xiàn)掛載緩存卷的3種高階應用場景
本文主要介紹了緩存卷掛載的3種高階應用場景,涵蓋多階段構(gòu)建、跨平臺編譯與CI/CD流水線中的實戰(zhàn)技巧,提升鏡像構(gòu)建效率與資源利用率,顯著縮短構(gòu)建時間,感興趣的可以了解一下2026-05-05

