docker配置鏡像Docker pull時(shí)報(bào)錯(cuò):https://registry-1.docker.io/v2/問題
更新時(shí)間:2026年01月19日 09:19:22 作者:竹杖芒鞋輕勝馬,誰怕?一蓑煙雨任平生。
Docker拉鏡像報(bào)錯(cuò)的原因可能是網(wǎng)絡(luò)問題、認(rèn)證問題、注冊中心URL不正確或注冊中心服務(wù)不可用,解決方法包括重載和重啟Docker服務(wù)
docker 拉鏡像報(bào)錯(cuò)
#docker pull centos:latest Error response from daemon: Get "https://registry-1.docker.io/v2/": context deadline exceeded**加粗樣式**
這個(gè)錯(cuò)誤表明Docker客戶端嘗試訪問Docker Hub或其他Docker注冊中心時(shí)出現(xiàn)了問題。
具體來說,是在嘗試獲取注冊中心API的響應(yīng)時(shí)遇到了錯(cuò)誤??赡艿脑虬ňW(wǎng)絡(luò)問題、認(rèn)證問題、注冊中心URL不正確或者注冊中心服務(wù)本身不可用
解決方法
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服務(wù)
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é)
以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
Docker中鏡像構(gòu)建文件Dockerfile與相關(guān)命令的詳細(xì)介紹
這篇文章主要介紹了Docker中鏡像構(gòu)建文件Dockerfile與相關(guān)命令的相關(guān)資料,文中介紹的很詳細(xì),相信對大家具有一定的參考價(jià)值,有需要的朋友們下面來一起看看吧。2017-02-02
Docker命令讓普通用戶能夠執(zhí)行的實(shí)現(xiàn)
這篇文章主要介紹了Docker命令讓普通用戶能夠執(zhí)行的實(shí)現(xiàn)操作,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧2021-03-03

