sail 8.1 でLaravelプロジェクトを立ち上げたのだが、下記エラーがでた。
=> ERROR [ 4/11] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && curl 9.3s
------
> [ 4/11] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /usr/share/keyrings/ppa_ondrej_php.gpg > /dev/null && echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.1-cli php8.1-dev php8.1-pgsql php8.1-sqlite3 php8.1-gd php8.1-curl php8.1-imap php8.1-mysql php8.1-mbstring php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap php8.1-intl php8.1-readline php8.1-ldap php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole php8.1-memcached php8.1-pcov php8.1-xdebug && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sLS https://deb.nodesource.com/setup_18.x | bash - && apt-get install -y nodejs && npm install -g npm && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarn.gpg >/dev/null && echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/pgdg.gpg >/dev/null && echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client-14 && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*:
#7 1.083 Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
#7 1.212 Get:2 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
#7 1.988 Get:3 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [781 kB]
#7 2.633 Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
#7 2.808 Get:5 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [593 kB]
#7 2.925 Get:6 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [667 kB]
#7 2.978 Get:7 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB]
#7 3.082 Get:8 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [4732 B]
#7 3.299 Get:9 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
#7 7.250 Get:10 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
#7 7.307 Get:11 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
#7 7.310 Get:12 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
#7 7.314 Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [641 kB]
#7 7.520 Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [970 kB]
#7 7.628 Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [8150 B]
#7 7.630 Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [972 kB]
#7 7.734 Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [3520 B]
#7 7.735 Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [7291 B]
#7 8.308 Fetched 24.9 MB in 8s (3179 kB/s)
#7 8.308 Reading package lists...
#7 9.142 E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
#7 9.142 E: Sub-process returned an error code
------
failed to solve: rpc error: code = Unknown desc = 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 && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /usr/share/keyrings/ppa_ondrej_php.gpg > /dev/null && echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list && apt-get update && apt-get install -y php8.1-cli php8.1-dev php8.1-pgsql php8.1-sqlite3 php8.1-gd php8.1-curl php8.1-imap php8.1-mysql php8.1-mbstring php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap php8.1-intl php8.1-readline php8.1-ldap php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole php8.1-memcached php8.1-pcov php8.1-xdebug && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer && curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - && apt-get install -y nodejs && npm install -g npm && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarn.gpg >/dev/null && echo "deb [signed-by=/usr/share/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /usr/share/keyrings/pgdg.gpg >/dev/null && echo "deb [signed-by=/usr/share/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list && apt-get update && apt-get install -y yarn && apt-get install -y mysql-client && apt-get install -y postgresql-client-$POSTGRES_VERSION && apt-get -y autoremove && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*]: exit code: 100
色々試した。
- ローカルのPHPを8.1に変えた
- docker-compose down --rmi all --volumesでボリュームも含め、dockerを落とした
- docker-compose.ymlのsailのバージョンを8.0にしてみた
結論。
dockerを再起動したら治った。
これから学んだ教訓、
もしわからないエラーが出たら、素直に再起動を試してみよう。