AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1400464
Accepted
Mona Jalal
Mona Jalal
Asked: 2022-04-02 14:46:53 +0800 CST2022-04-02 14:46:53 +0800 CST 2022-04-02 14:46:53 +0800 CST

docker:来自守护进程的错误响应:获取 https://registry-1.docker.io/v2/:net/http:请求在等待连接时取消

  • 772

如何在 Ubuntu 20.04 中解决此问题?

[18:31:29] (dpcc) jalal@echo:~/research/code$ sudo docker pull docurdt/heal
[sudo] password for jalal: 
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)


$ uname -a
Linux echo 5.4.0-99-generic #112-Ubuntu SMP Thu Feb 3 13:50:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux


$ docker --version
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

我对 CentOS 7 上的这个 $ docker pull 没有问题。

这是我使用的代理~/.bashrc:

export http_proxy="http://webproxy.bu.edu:8900"
export https_proxy="http://webproxy.bu.edu:8900"
export ftp_proxy="http://webproxy.bu.edu:8900"
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,.bu.edu,.ad.bu.edu,128.197.,10."

添加了这些,config.json但注销后错误仍然存​​在:

$ cat ~/.docker/config.json 
{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://webproxy.bu.edu:8900",
     "httpsProxy": "http://webproxy.bu.edu:8900",
     "noProxy": "localhost,127.0.0.1,.bu.edu,.ad.bu.edu,128.197.,10."
   }
 }
}

我得到:

[19:38:02] jalal@echo:~/research/code$ docker pull docurdt/heal
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
20.04
  • 1 1 个回答
  • 5501 Views

1 个回答

  • Voted
  1. Best Answer
    Mona Jalal
    2022-04-02T16:00:05+08:002022-04-02T16:00:05+08:00
    $ sudo mkdir -p /etc/systemd/system/docker.service.d
    
    $ sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf
    
    $ sudo systemctl daemon-reload
    
    $ sudo  systemctl restart docker
    
    
    $ docker pull docurdt/heal
    Using default tag: latest
    latest: Pulling from docurdt/heal
    e79bb959ec00: Pull complete 
    7dc808d5d247: Pull complete 
    04e0dd83f1c1: Pull complete 
    7680ea831bfd: Pull complete 
    f861c2ba948a: Pull complete 
    27ae46f94ae6: Pull complete 
    92a8fc1df4e5: Pull complete 
    d6ff073d4a06: Pull complete 
    626ee3046583: Pull complete 
    Digest: sha256:31f30cf69b3271fffcba4c439ee19c92587969cd74ec649ec72dec84ce177b86
    Status: Downloaded newer image for docurdt/heal:latest
    docker.io/docurdt/heal:latest
    

    这就是我在 http-proxy.conf 中的内容:

    $ cat /etc/systemd/system/docker.service.d/http-proxy.conf
    [Service]
    Environment="HTTP_PROXY=http://webproxy.bu.edu:8900"
    Environment="HTTPS_PROXY="http://webproxy.bu.edu:8900"
    

    非常感谢 IRC 的 twainwek 抽出宝贵时间并与我分享此链接https://github.com/docker/for-win/issues/1534#issuecomment-405903684

    • 0

相关问题

  • 如何在 18.04..20.04 上设置本地通配符 (127.0.0.1) 域解析?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve