使用 sail 和 docker 构建新的 laravel 项目时遇到问题

使用 sail 和 docker 构建新的 laravel 项目时遇到问题

我正在使用 docker 和 sail 创建一个新的 laravel 项目,我在 Windows 10 上,我已经启用了 WSL 2 以及文档中要求的所有内容,但是在我在 ubuntu shell(Ubuntu 20.04)中创建 laravel 项目并使用以下命令构建 sail

cd example-app && ./vendor/bin/sail up

我得到以下信息:

#7 737.3 0 upgraded, 123 newly installed, 0 to remove and 3 not upgraded.
#7 737.3 Need to get 81.6 MB of archives.
#7 737.3 After this operation, 309 MB of additional disk space will be used.

#7 789.8 Err:28 http://ppa.launchpad.net/ondrej/php/ubuntu hirsute/main amd64 php8.0-cli amd64 8.0.11-1+ubuntu21.04.1+deb.sury.org+1
#7 789.8   Undetermined Error [IP: 91.189.95.85 80]

#7 811.8 Err:34 http://ppa.launchpad.net/ondrej/php/ubuntu hirsute/main amd64 php8.0-imap amd64 8.0.11-1+ubuntu21.04.1+deb.sury.org+1
#7 811.8   Undetermined Error [IP: 91.189.95.85 80]

#7 1002.0 Get:121 http://archive.ubuntu.com/ubuntu hirsute/main amd64 pkg-config amd64 0.29.2-1ubuntu1 [46.2 kB]
#7 1002.2 Get:122 http://archive.ubuntu.com/ubuntu hirsute/main amd64 shtool all 2.0.8-10 [122 kB]
#7 1002.7 Get:123 http://archive.ubuntu.com/ubuntu hirsute/main amd64 pkg-php-tools all 1.40 [28.0 kB]
#7 1002.8 EFetched 80.0 MB in 4min 26s (301 kB/s)
#7 1002.8 : Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php8.0/php8.0-cli_8.0.11-1%2bubuntu21.04.1%2bdeb.sury.org%2b1_amd64.deb  Undetermined Error [IP: 91.189.95.85 80]
#7 1002.8 E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php8.0/php8.0-imap_8.0.11-1%2bubuntu21.04.1%2bdeb.sury.org%2b1_amd64.deb  Undetermined Error [IP: 91.189.95.85 80]
#7 1002.8 E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php8.0/php8.0-soap_8.0.11-1%2bubuntu21.04.1%2bdeb.sury.org%2b1_amd64.deb  Undetermined Error [IP: 91.189.95.85 80]
#7 1002.8 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
------
executor failed running [/bin/sh -c apt-get update     && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2     && mkdir -p ~/.gnupg     && chmod 600 ~/.gnupg     && echo "disable-ipv6" >> ~/.gnupg/dirmngr.conf     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C     && apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C     && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu hirsute main" > /etc/apt/sources.list.d/ppa_ondrej_php.list     && apt-get update     && apt-get install -y php8.0-cli php8.0-dev        php8.0-pgsql php8.0-sqlite3 php8.0-gd        php8.0-curl php8.0-memcached        php8.0-imap php8.0-mysql php8.0-mbstring        php8.0-xml php8.0-zip php8.0-bcmath php8.0-soap        php8.0-intl php8.0-readline php8.0-pcov        php8.0-msgpack php8.0-igbinary php8.0-ldap        php8.0-redis php8.0-swoole php8.0-xdebug     && php -r "readfile('http://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && curl -sL https://deb.nodesource.com/setup_16.x | bash -     && apt-get install -y nodejs     && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -     && echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list     && apt-get update     && apt-get install -y yarn     && apt-get install -y mysql-client     && apt-get install -y postgresql-client     && apt-get -y autoremove     && apt-get clean     && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
ERROR: Service 'laravel.test' failed to build : Build failed

问题似乎在于

#7 830.7 Err:53 http://ppa.launchpad.net/ondrej/php/ubuntu hirsute/main amd64 php8.0-soap amd64 8.0.11-1+ubuntu21.04.1+deb.sury.org+1
#7 830.7   Undetermined Error [IP: 91.189.95.85 80]

我尝试从 docker 中删除所有容器、卷和图像,然后重新执行整个过程,但无济于事。

我也尝试在命令前使用 sudo

cd example-app && sudo ./vendor/bin/sail up

但结果是一样的。


相关内容