LoginSignup
24
18

More than 5 years have passed since last update.

Dockerfileで、質問を受けずにrootで`composer install`する

Posted at

やること

パッケージによって出る[Y,n]で処理が止まらないようにする。

# みたいな
Set Folder Permissions ? (Default to Y) [Y,n]? 

あと、rootユーザーだとこんな警告が出るのでそれを出ないようにする。

Do not run Composer as root/super user! See https://getcomposer.org/root for details

RUN composer installより前に環境変数を設定

使うのは2つ。

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_NO_INTERACTION 1

# RUN composer install

COMPOSER_ALLOW_SUPERUSER

1を設定するとrootでのインストールを許可できる。

COMPOSER_NO_INTERACTION

1を設定すると何も聞いてこないくなる。

24
18
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
24
18