尽管有互联网连接,Docker compose 仍失败并出现连接错误

尽管有互联网连接,Docker compose 仍失败并出现连接错误
=> [internal] load build definition from Dockerfile                                                                    0.1s
 => => transferring dockerfile: 470B                                                                                    0.0s
 => [internal] load .dockerignore                                                                                       0.0s
 => => transferring context: 2B                                                                                         0.0s
 => [internal] load metadata for docker.io/library/php:5.6-fpm                                                         25.0s
 => [internal] load metadata for docker.io/library/composer:latest                                                      0.0s
 => CACHED [composer 1/3] FROM docker.io/library/composer                                                               0.0s
 => CACHED [stage-1 1/7] FROM docker.io/library/php:5.6-fpm@sha256:4f070f1b7b93cc5ab364839b79a5b26f38d5f89461f7bc0cd4b  0.0s
 => [internal] load build context                                                                                       1.8s
 => => transferring context: 51.53MB                                                                                    1.7s
 => ERROR [stage-1 2/7] RUN apt-get update &&     apt-get install -y      git      curl      wget      unzip          121.8s
 => [composer 2/3] COPY / /app                                                                                          2.2s
 => [composer 3/3] RUN composer install --ignore-platform-reqs --no-scripts                                             1.1s
------                                                                                                                       
 > [stage-1 2/7] RUN apt-get update &&     apt-get install -y                                   git                         curl                                     wget                                    unzip:                                       
#0 76.47 Ign:1 http://security.debian.org/debian-security stretch/updates InRelease                                          
#0 76.48 Ign:2 http://security.debian.org/debian-security stretch/updates Release                                            
#0 76.48 Ign:3 http://security.debian.org/debian-security stretch/updates/main all Packages                                  
#0 76.48 Ign:4 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 76.48 Ign:3 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 76.48 Ign:4 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 76.49 Ign:3 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 76.49 Ign:4 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 76.49 Ign:3 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 76.49 Ign:4 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 76.49 Ign:3 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 76.49 Ign:4 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 76.49 Ign:3 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 76.49 Err:4 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 76.49   Unable to connect to security.debian.org:http: [IP: 151.101.194.132 80]
#0 121.6 Err:5 http://deb.debian.org/debian stretch InRelease
#0 121.6   Could not connect to deb.debian.org:80 (199.232.46.132), connection timed out
#0 121.6 Err:6 http://deb.debian.org/debian stretch-updates InRelease
#0 121.6   Unable to connect to deb.debian.org:http:
#0 121.7 Reading package lists...
#0 121.7 W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
#0 121.7 W: Failed to fetch http://deb.debian.org/debian/dists/stretch/InRelease  Could not connect to deb.debian.org:80 (199.232.46.132), connection timed out
#0 121.7 W: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/InRelease  Unable to connect to deb.debian.org:http:
#0 121.7 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages  Unable to connect to security.debian.org:http: [IP: 151.101.194.132 80]
#0 121.7 W: Some index files failed to download. They have been ignored, or old ones used instead.
------
failed to solve: process "/bin/sh -c apt-get update &&     apt-get install -y \t\t\t\t\tgit \t\t\t\t\tcurl \t\t\t\t\twget \t\t\t\t\tunzip" did not complete successfully: exit code: 100

我有功能齐全的互联网连接,但当我尝试这样做时docker compose up,会发生此错误,提示它无法连接到 IP 地址,但可以通过我的浏览器访问。

我应该寻找什么来解决这个问题?我的机器是 Ubuntu 22.03,docker 安装正确,并且相同的 compose 文件可以在 Manjaro 中运行。

相关内容