curl 无法访问 download.docker.com 的问题的解决方法

devtools/2024/9/22 19:16:27/

一. 问题

在按照 Docker Standalone | SigNoz 中的说明安装SigNoz之时出现下面的输出:
 

$ ./install.sh 👋 Thank you for trying out SigNoz! 🟡 Running installer with non-sudo permissions.In case of any failure or prompt, please consider running the script with sudo privileges.🌏 Detecting your OS ...🙇 We will need sudo access to complete the installation.
Please enter your sudo password, if prompted.
Got it! Thanks!! 🙏Okay! We will bring up the SigNoz cluster from here 🚀++++++++++++++++++++++++
Setting up docker repos
Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:2 http://mirrors.163.com/ubuntu noble InRelease
Hit:3 http://mirrors.163.com/ubuntu noble-updates InRelease
Hit:4 http://mirrors.163.com/ubuntu noble-backports InRelease
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
software-properties-common is already the newest version (0.99.48).
gnupg-agent is already the newest version (2.4.4-2ubuntu17).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
curl: (28) Failed to connect to download.docker.com port 443 after 135963 ms: Couldn't connect to server
gpg: no valid OpenPGP data found.
🔴 The containers didn't seem to start correctly. Please run the following command to check containers that may have errored out:sudo docker-compose -f ./docker/clickhouse-setup/docker-compose.yaml ps -a
Please read our troubleshooting guide https://signoz.io/docs/install/troubleshooting/
or reach us for support in #help channel in our Slack Community https://signoz.io/slack
++++++++++++++++++++++++++++++++++++++++📨 Please share your email to receive support with the installation
Email:

重点:

curl: (28) Failed to connect to download.docker.com port 443 after 135963 ms: Couldn't connect to server

原因是 docker 官网不知道是什么原因被科学掉了。

二. 解决步骤

第一步

打开 install.sh 文件,修改

curl -fsSL "https://download.docker.com/linux/$os/gpg" | $sudo_cmd apt-key add -

curl -fsSL "https://mirrors.163.com/docker-ce/linux/$os/gpg" | $sudo_cmd apt-key add -

这样就用网易镜像替代官网了。

接着尝试安装:

$ ./install.sh 👋 Thank you for trying out SigNoz! 🟡 Running installer with non-sudo permissions.In case of any failure or prompt, please consider running the script with sudo privileges.🌏 Detecting your OS ...🙇 We will need sudo access to complete the installation.
Please enter your sudo password, if prompted.
[sudo] password for dhfang: 
Got it! Thanks!! 🙏Okay! We will bring up the SigNoz cluster from here 🚀++++++++++++++++++++++++
Setting up docker repos
Hit:1 http://mirrors.163.com/ubuntu noble InRelease
Hit:2 http://mirrors.163.com/ubuntu noble-updates InRelease
Hit:3 http://mirrors.163.com/ubuntu noble-backports InRelease
Get:4 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Fetched 126 kB in 3s (39.6 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
software-properties-common is already the newest version (0.99.48).
gnupg-agent is already the newest version (2.4.4-2ubuntu17).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK
Repository: 'deb [arch=amd64] https://mirrors.163.com/docker-ce/linux/ubuntu noble stable'
Description:
Archive for codename: noble components: stable
More info: https://mirrors.163.com/docker-ce/linux/ubuntu
Adding repository.
Press [ENTER] to continue or Ctrl-c to cancel.
Adding deb entry to /etc/apt/sources.list.d/archive_uri-https_mirrors_163_com_docker-ce_linux_ubuntu-noble.list
Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-https_mirrors_163_com_docker-ce_linux_ubuntu-noble.list
Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:2 http://mirrors.163.com/ubuntu noble InRelease                              
Get:3 https://mirrors.163.com/docker-ce/linux/ubuntu noble InRelease [48.8 kB]   
Hit:4 http://mirrors.163.com/ubuntu noble-updates InRelease
Hit:5 http://mirrors.163.com/ubuntu noble-backports InRelease
Get:6 https://mirrors.163.com/docker-ce/linux/ubuntu noble/stable amd64 Packages [12.4 kB]
Fetched 61.2 kB in 2s (32.5 kB/s)   
Reading package lists... Done
W: https://mirrors.163.com/docker-ce/linux/ubuntu/dists/noble/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Hit:1 https://mirrors.163.com/docker-ce/linux/ubuntu noble InRelease
Hit:2 http://mirrors.163.com/ubuntu noble InRelease
Hit:3 http://mirrors.163.com/ubuntu noble-updates InRelease
Hit:4 http://mirrors.163.com/ubuntu noble-backports InRelease
Hit:5 http://security.ubuntu.com/ubuntu noble-security InRelease
Reading package lists...
W: https://mirrors.163.com/docker-ce/linux/ubuntu/dists/noble/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Installing docker
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:docker-buildx-plugin docker-ce-rootless-extras docker-compose-plugin libltdl7 libslirp0 pigz slirp4netns
Suggested packages:aufs-tools cgroupfs-mount | cgroup-lite
The following NEW packages will be installed:containerd.io docker-buildx-plugin docker-ce docker-ce-cli docker-ce-rootless-extras docker-compose-plugin libltdl7libslirp0 pigz slirp4netns
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 122 MB of archives.
After this operation, 437 MB of additional disk space will be used.
Get:1 http://mirrors.163.com/ubuntu noble/universe amd64 pigz amd64 2.8-1 [65.6 kB]
Get:2 https://mirrors.163.com/docker-ce/linux/ubuntu noble/stable amd64 containerd.io amd64 1.7.20-1 [30.5 MB]
Get:3 http://mirrors.163.com/ubuntu noble/main amd64 libltdl7 amd64 2.4.7-7build1 [40.3 kB]
Get:4 http://mirrors.163.com/ubuntu noble/main amd64 libslirp0 amd64 4.7.0-1ubuntu3 [63.8 kB]
Get:5 http://mirrors.163.com/ubuntu noble/universe amd64 slirp4netns amd64 1.2.1-1build2 [34.9 kB]
Get:6 https://mirrors.163.com/docker-ce/linux/ubuntu noble/stable amd64 docker-buildx-plugin amd64 0.16.2-1~ubuntu.24.04~noble [29.9 MB]
Get:7 https://mirrors.163.com/docker-ce/linux/ubuntu noble/stable amd64 docker-ce-cli amd64 5:27.1.2-1~ubuntu.24.04~noble [14.6 MB]
Get:8 https://mirrors.163.com/docker-ce/linux/ubuntu noble/stable amd64 docker-ce amd64 5:27.1.2-1~ubuntu.24.04~noble [25.2 MB]
Get:9 https://mirrors.163.com/docker-ce/linux/ubuntu noble/stable amd64 docker-ce-rootless-extras amd64 5:27.1.2-1~ubuntu.24.04~noble [9318 kB]
Get:10 https://mirrors.163.com/docker-ce/linux/ubuntu noble/stable amd64 docker-compose-plugin amd64 2.29.1-1~ubuntu.24.04~noble [12.5 MB]
Fetched 122 MB in 36s (3436 kB/s)
Selecting previously unselected package pigz.
(Reading database ... 83400 files and directories currently installed.)
Preparing to unpack .../0-pigz_2.8-1_amd64.deb ...
Unpacking pigz (2.8-1) ...
Selecting previously unselected package containerd.io.
Preparing to unpack .../1-containerd.io_1.7.20-1_amd64.deb ...
Unpacking containerd.io (1.7.20-1) ...
Selecting previously unselected package docker-buildx-plugin.
Preparing to unpack .../2-docker-buildx-plugin_0.16.2-1~ubuntu.24.04~noble_amd64.deb ...
Unpacking docker-buildx-plugin (0.16.2-1~ubuntu.24.04~noble) ...
Selecting previously unselected package docker-ce-cli.
Preparing to unpack .../3-docker-ce-cli_5%3a27.1.2-1~ubuntu.24.04~noble_amd64.deb ...
Unpacking docker-ce-cli (5:27.1.2-1~ubuntu.24.04~noble) ...
Selecting previously unselected package docker-ce.
Preparing to unpack .../4-docker-ce_5%3a27.1.2-1~ubuntu.24.04~noble_amd64.deb ...
Unpacking docker-ce (5:27.1.2-1~ubuntu.24.04~noble) ...
Selecting previously unselected package docker-ce-rootless-extras.
Preparing to unpack .../5-docker-ce-rootless-extras_5%3a27.1.2-1~ubuntu.24.04~noble_amd64.deb ...
Unpacking docker-ce-rootless-extras (5:27.1.2-1~ubuntu.24.04~noble) ...
Selecting previously unselected package docker-compose-plugin.
Preparing to unpack .../6-docker-compose-plugin_2.29.1-1~ubuntu.24.04~noble_amd64.deb ...
Unpacking docker-compose-plugin (2.29.1-1~ubuntu.24.04~noble) ...
Selecting previously unselected package libltdl7:amd64.
Preparing to unpack .../7-libltdl7_2.4.7-7build1_amd64.deb ...
Unpacking libltdl7:amd64 (2.4.7-7build1) ...
Selecting previously unselected package libslirp0:amd64.
Preparing to unpack .../8-libslirp0_4.7.0-1ubuntu3_amd64.deb ...
Unpacking libslirp0:amd64 (4.7.0-1ubuntu3) ...
Selecting previously unselected package slirp4netns.
Preparing to unpack .../9-slirp4netns_1.2.1-1build2_amd64.deb ...
Unpacking slirp4netns (1.2.1-1build2) ...
Setting up docker-buildx-plugin (0.16.2-1~ubuntu.24.04~noble) ...
Setting up containerd.io (1.7.20-1) ...
Setting up docker-compose-plugin (2.29.1-1~ubuntu.24.04~noble) ...
Setting up libltdl7:amd64 (2.4.7-7build1) ...
Setting up docker-ce-cli (5:27.1.2-1~ubuntu.24.04~noble) ...
Setting up libslirp0:amd64 (4.7.0-1ubuntu3) ...
Setting up pigz (2.8-1) ...
Setting up docker-ce-rootless-extras (5:27.1.2-1~ubuntu.24.04~noble) ...
Setting up slirp4netns (1.2.1-1build2) ...
Setting up docker-ce (5:27.1.2-1~ubuntu.24.04~noble) ...
Could not execute systemctl:  at /usr/bin/deb-systemd-invoke line 148.
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.2) ...
Scanning processes...                                                                                                           
Scanning linux images...                                                                                                        Running kernel seems to be up-to-date.No services need to be restarted.No containers need to be restarted.No user sessions are running outdated binaries.No VM guests are running outdated hypervisor (qemu) binaries on this host.🙇 We will need sudo access to complete the installation.
Please enter your sudo password, if prompted.
Got it! Thanks!! 🙏Okay! We will bring up the SigNoz cluster from here 🚀++++++++++++++++++++++++
Installing docker-compose
Downloading docker-compose from https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-linux-x86_64% Total    % Received % Xferd  Average Speed   Time    Time     Time  CurrentDload  Upload   Total   Spent    Left  Speed0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     00 60.2M    0  143k    0     0     65      0  11d 05h  0:37:16  11d 05h     0
curl: (56) Recv failure: Connection reset by peer
🔴 The containers didn't seem to start correctly. Please run the following command to check containers that may have errored out:sudo docker-compose -f ./docker/clickhouse-setup/docker-compose.yaml ps -a
Please read our troubleshooting guide https://signoz.io/docs/install/troubleshooting/
or reach us for support in #help channel in our Slack Community https://signoz.io/slack
++++++++++++++++++++++++++++++++++++++++📨 Please share your email to receive support with the installation
Email: 

下载下面这个东西时,非常慢,要 11 天 5 小时,然后就连接被重置,接收失败了。 https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-linux-x86_64

第二步

再次运行 install.sh 已经不会再去下载这个东西了,用下面的命令手工重新下载:

sudo curl -L https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose

趁科学不注意,多试几次可以下载成功。

实在不行,有一个老哥提供了百度云下载

https://blog.csdn.net/weixin_45844208/article/details/140657902

下载 docker-compose-linux-x86_64.v2.29.2 后复制到 /usr/local/bin 重命名为 docker-compose 并且用 sudo chmod +x /usr/local/bin/docker-compose 命名使之可执行。

再用 sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 创建一个符号

经过上面 2 步,终于科学地成功安装 docker-compose

第三步

再次运行 install.sh,它开始获取容器image,结果依旧是超时错误,啥也获取不到。

这一步卡住了,因为所有的国内 docker 仓库都没用了,如有人知道如何弄,请告诉我。


http://www.ppmy.cn/devtools/99771.html

相关文章

深入理解二叉树层级遍历与应用:从基础到进阶

深入理解二叉树层级遍历与应用:从基础到进阶 在数据结构与算法的学习中,二叉树的遍历是一个关键主题,尤其是层级遍历(广度优先搜索,BFS)。本文将深入探讨二叉树的层级遍历,并在此基础上进行扩展…

常见分布式ID解决方案的优缺点

分布式系统之所以难,很重要的原因之一是“没有一个全局时钟,难以保证绝对的时序”。 一、分布式ID的特性或要求: 唯一性:确保生成的ID是应用系统内唯一。高可用性:确保任何时候都能正确的生成ID。有意义:或者说包含更多信息,例如时间、业务等信息。如:有序性,通常都需…

基于cubemx的STM32的freertos的串口通信

1、任务描述 使用freertos系统实现电脑调试助手和正点原子开发板STM32F103ZET6的串口通信。 2、cubemx设置 3、程序代码 (1)添加usart1.c #include "usart1.h"#include "usart.h"/**********重定义函数**********/struct __FILE …

C++面试基础系列-macro_definition宏定义

系列文章目录 文章目录 系列文章目录C面试基础系列-macro_definition宏定义Overview1.宏定义的概念1.1. 基本宏定义1.2. 带参数的宏1.3. 条件编译1.4. 宏的展开1.5. 宏的副作用1.6. 宏与类型1.7. 宏的撤销1.8. 宏的可见性1.9. 避免宏冲突1.10. 宏与函数的区别1.11. 字符串化操作…

Rust: 技术介绍

简介 Rust是一门由Mozilla基金会开发的系统编程语言,其设计目标是在保证内存安全的同时提供高性能和并发编程能力。Rust的出现旨在解决C和C等语言在内存管理方面的复杂性,同时保持与这些语言相近的性能水平。下面,我们将从Rust的基础使用、高…

SSRF以及CSRF

ssrf 服务端请求伪造:由于服务端提供了从其他服务器应用获取数据的功能,但又没有对目标地址做严格过滤与限制,导致攻击者可以传入任意的地址来让后端服务器对其发起请求,并返回对该目标地址请求的数据 数据流:攻击者…

基于STM32开发的智能水箱液位控制系统

目录 引言环境准备工作 硬件准备软件安装与配置系统设计 系统架构硬件连接代码实现 系统初始化液位监测与控制水泵控制与状态显示Wi-Fi通信与远程监控应用场景 家庭用水系统的液位控制工业水箱的液位管理常见问题及解决方案 常见问题解决方案结论 1. 引言 智能水箱液位控制系…

AI在医学领域:GluFormer一种可泛化的连续血糖监测数据分析基础模型

糖尿病是一种全球性的健康挑战,影响着各个年龄段和不同地理区域的人群。根据最新数据,全球糖尿病患者人数已超过5亿,且每年以惊人的速度增长,相关的医疗费用也居高不下。2型糖尿病(T2DM)作为最主要的糖尿病…