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

server/2024/10/25 14:22:16/

一. 问题

在按照 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/server/104511.html

相关文章

Vector vs 数组:Java中Vector相比数组的优点

每日自动更新各类学习教程及工具下载合集 ​​https://pan.quark.cn/s/874c74e8040e​​ 在Java编程中,数组(Array)和Vector都是用于存储数据的容器,但它们在设计和功能上有所不同。选择使用哪种数据结构取决于具体的需求。在这…

Java开发笔记-小程序微信支付接入

步骤: 1.注册微信商户,开通小程序支付业务,获得必要接入参数。(Certificate、PrivateKey、merchantId、SerialNumbe、apiV3Key) 2.微信商户号关联小程序(需目标小程序审核) 3.java使用接入参数发起下单,获取下单参数。 4.小程…

控制反转(IOC)——Spring第一个核心思想

控制反转概述 控制反转(IoC)是一种将对象的创建、组装和管理交给容器或框架来实现的编程思想。它可以减低对象之间的耦合度,提高代码的灵活性和模块化。控制反转的一种常见形式是依赖注入(DI),即对象的依赖…

【Kotlin设计模式】Kotlin实现工厂模式

前言 工厂模式(Factory Pattern)是一种创建型设计模式,提供一个创建对象的接口,不暴露对象的创建过程。它将实例化对象的任务交给子类或具体实现,从而使得客户端代码与具体类解耦。 工厂模式主要分为以下三类&#xf…

【通俗易懂】一篇文章带你了解Redis的过期策略与内存淘汰策略

目录 一、过期策略 二、内存淘汰策略 2.1 介绍 2.2 如何选择? 一、过期策略 Redis 通过设置过期时间来控制键值对的生命周期。过期时间可以通过EXPIRE、EXPIREAT、PERSIST等命令设置,也可以在插入数据时直接设置过期时间。 Redis 的过期策略采用的…

交直流充电桩检测的核心功能

交直流充电桩检测的核心功能主要包括以下几个方面: 1. 充电状态监测:充电桩检测系统需要实时监测充电设备的运行状态,包括充电电流、电压、功率等参数。通过对这些参数的实时监测,可以确保充电过程的安全和稳定。同时&#xff0c…

密码管理系统的自动化与集成:重塑安全与效率的双重飞跃

在数字化时代,密码作为保护个人信息、企业资产及敏感数据的第一道防线,其重要性不言而喻。然而,随着网络应用的激增和复杂性的提升,传统的密码管理方式——如使用简单密码、重复密码或依赖记忆——已难以满足现代安全需求&#xf…

2024/08(二) 近期关于AI的阅读和理解[笔记]

## Multi Agent/Flow 最近团队在实验 flowise 的 Agentflows 设计,顺带看了现在市面多加解决方案,这两天偶尔看到蚂蚁CodeFuse团队开发的Mulit Agent框架开发思想, 所以将他们一起总结归纳下。 Agent Base:构建了四种基本的Agent…