Laravel Sail在第一次执行up安装构建laravel.test的时候出现报错
OS: windows 10
Docker Desktop: 3.5.1(66090)
wsl2: Ubuntu 20.04 LTS
我是按照《搭建 Laravel Sail 开发环境 - Windows》文档,通过curl -s https://laravel.build/example-app | bash
命令创建
执行./vendor/bin/sail up
进行第一次构建,在Building laravel.test
时报错了,我用的是7.4,8.0也执行过都是一样的报错
另外有魔(ke)法(xue)上网,应该不是网络问题,用的是清华大学的镜像
报错信息如下:
Building laravel.test
[+] Building 69.9s (9/16)
=> [internal] load build definition from Dockerfile 1.0s
=> => transferring dockerfile: 32B 0.1s
=> [internal] load .dockerignore 1.3s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:21.04 33.2s
=> [ 1/12] FROM docker.io/library/ubuntu:21.04@sha256:a30456233740024b9d297f5bcaa7439446a97bc59b25cadcdae829c334 0.0s
=> [internal] load build context 0.4s
=> => transferring context: 1.03kB 0.0s
=> CACHED [ 2/12] WORKDIR /var/www/html 0.0s
=> CACHED [ 3/12] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone 0.0s
=> [ 4/12] ADD sources.list /etc/apt/ 1.0s
=> ERROR [ 5/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git sup 33.5s
------
> [ 5/12] RUN 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 https://launchpad.proxy.ustclug.org/ondrej/php/ubuntu hirsute main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php7.4-cli php7.4-dev php7.4-pgsql php7.4-sqlite3 php7.4-gd php7.4-curl php7.4-memcached php7.4-imap php7.4-mysql php7.4-mbstring php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap php7.4-intl php7.4-readline php7.4-pcov php7.4-msgpack php7.4-igbinary php7.4-ldap php7.4-redis && curl -so /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar && chmod a+x /usr/bin/composer && composer --version && composer config -g repo.packagist composer https://mirrors.aliyun.com/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/*:
#9 1.801 Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal InRelease [265 kB]
#9 2.739 Get:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates InRelease [114 kB]
#9 3.060 Get:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports InRelease [101 kB]
#9 3.500 Get:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security InRelease [114 kB]
#9 3.949 Get:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/multiverse amd64 Packages [177 kB]
#9 4.258 Get:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/main amd64 Packages [1275 kB]
#9 6.923 Get:7 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/restricted amd64 Packages [33.4 kB]
#9 6.934 Get:8 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal/universe amd64 Packages [11.3 MB]
#9 25.82 Get:9 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/restricted amd64 Packages [416 kB]
#9 25.95 Get:10 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/main amd64 Packages [1367 kB]
#9 26.72 Get:11 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/multiverse amd64 Packages [32.0 kB]
#9 26.72 Get:12 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-updates/universe amd64 Packages [1051 kB]
#9 27.06 Get:13 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/main amd64 Packages [2668 B]
#9 27.07 Get:14 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-backports/universe amd64 Packages [6315 B]
#9 27.07 Get:15 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/restricted amd64 Packages [368 kB]
#9 27.17 Get:16 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/universe amd64 Packages [779 kB]
#9 27.84 Get:17 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/main amd64 Packages [930 kB]
#9 28.18 Get:18 http://mirrors.tuna.tsinghua.edu.cn/ubuntu focal-security/multiverse amd64 Packages [27.6 kB]
#9 28.33 Fetched 18.4 MB in 27s (687 kB/s)
#9 28.33 Reading package lists...
#9 29.82 Reading package lists...
#9 31.35 Building dependency tree...
#9 31.60 Reading state information...
#9 31.74 Some packages could not be installed. This may mean that you have
#9 31.74 requested an impossible situation or if you are using the unstable
#9 31.74 distribution that some required packages have not yet been created
#9 31.74 or been moved out of Incoming.
#9 31.74 The following information may help to resolve the situation:
#9 31.74
#9 31.75 The following packages have unmet dependencies:
#9 31.91 gnupg : Depends: gpgv (< 2.2.19-3ubuntu2.1.1~) but 2.2.20-1ubuntu3 is to be installed
#9 31.91 perl : Depends: perl-base (= 5.30.0-9ubuntu0.2) but 5.32.1-3ubuntu2 is to be installed
#9 31.91 Recommends: netbase but it is not going to be installed
#9 31.91 perl-base : Breaks: perl (< 5.32.1~) but 5.30.0-9ubuntu0.2 is to be installed
#9 31.91 zlib1g-dev : Depends: zlib1g (= 1:1.2.11.dfsg-2ubuntu1.2) but 1:1.2.11.dfsg-2ubuntu6 is to be installed
#9 31.91 Depends: libc6-dev but it is not going to be installed or
#9 31.91 libc-dev
#9 31.93 E: Unable to correct problems, you have held broken packages.
------
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 https://launchpad.proxy.ustclug.org/ondrej/php/ubuntu hirsute main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php7.4-cli php7.4-dev php7.4-pgsql php7.4-sqlite3 php7.4-gd php7.4-curl php7.4-memcached php7.4-imap php7.4-mysql php7.4-mbstring php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap php7.4-intl php7.4-readline php7.4-pcov php7.4-msgpack php7.4-igbinary php7.4-ldap php7.4-redis && curl -so /usr/bin/composer https://mirrors.aliyun.com/composer/composer.phar && chmod a+x /usr/bin/composer && composer --version && composer config -g repo.packagist composer https://mirrors.aliyun.com/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.4的DockerFile添加 RUN apt-get update\
后面添加 && apt-get upgrade \
希望在构建前更新源,不过还是失败了,报同样的错
RUN apt-get update \
&& apt-get upgrade \
&& 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 \
现在很懵逼,不知道是不是镜像源有问题,或者是对应的wsl的Ubuntu有问题
推荐文章: