LoginSignup
1
0

More than 1 year has passed since last update.

【Dockerエラー】RUN apt-get update && apt-get install

Posted at

環境

Laravel v9.5.1 (PHP v8.1.3)

状況

ドキュメントのやり方(「macOSではじめる」)に沿って環境構築していた際、下記のエラー。

% .vendor/bin/sail up

Building laravel.test
[+] Building 98.4s (9/16)                                                                                                                                                                                                                     
 => [internal] load build definition from Dockerfile                                                                                                                                                                                     0.0s
 => => transferring dockerfile: 37B                                                                                                                                                                                                      0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                                                                          0.0s
 => [internal] load metadata for docker.io/library/ubuntu:21.10                                                                                                                                                                          4.1s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                                                                                                                                                            0.0s
 => [internal] load build context                                                                                                                                                                                                        0.0s
 => => transferring context: 99B                                                                                                                                                                                                         0.0s
 => [ 1/11] FROM docker.io/library/ubuntu:21.10@sha256:02c0317b899ca5595fa17870cedd9550962dbdb2e0b55def01                                                                                                                0.0s
 => CACHED [ 2/11] WORKDIR /var/www/html                                                                                                                                                                                                 0.0s
 => CACHED [ 3/11] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone                                                                                                                                        0.0s
 => 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     && mkdir -p ~/.gnupg     && chmod 600 ~/.gnupg     && echo "disable  94.1s
------                                                                                                                                                                                                                                        

解決方法

buildしてからupしたらうまく行った。

新しいサービスを初めて立ち上げる場合はbuildでimageを構築しないと、キャッシュがないのでイメージの構築から、コンテナの構築・起動までできない。

% ./vendor/bin/sail build
% ./vendor/bin/sail up

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0