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

一. 问题

在按照 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 libltdl7
  libslirp0 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  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0 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 仓库都没用了,如有人知道如何弄,请告诉我。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值