
ショコラ
ドッカーファイルの中でコンポーザーでパッケージをインストールするには?
ドッカーファイルの中でコンポーザーを使ってインストールを行うと、以下の警告が表示されてしまいます。この対処方法です。
①「Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.」
②「Do not run Composer as root/super user! See https://getcomposer.org/root for details」

もっさん先輩
composer でインストールする前に、環境変数 COMPOSER_ALLOW_SUPERUSER と COMPOSER_NO_INTERACTION を設定します。
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_NO_INTERACTION 1
具体的にはこんな感じです。
ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_NO_INTERACTION 1
RUN composer require livewire/livewire
以上