dockerizer icon indicating copy to clipboard operation
dockerizer copied to clipboard

RUN "composer install" Does break docker build.

Open dedfft opened this issue 1 year ago • 3 comments

Thank you for your reply. I tried this multiple times. I get this error every time. Strictly followed instructions

=> ERROR [5/6] RUN composer install --no-interaction --no-scripts --no-suggest                                                         0.5s
------
> [5/6] RUN composer install --no-interaction --no-scripts --no-suggest:
0.498 Composer plugins have been disabled for safety in this non-interactive session.
0.498 Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
0.498 Do not run Composer as root/super user! See https://getcomposer.org/root for details
0.509 You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.
0.509 Composer could not find a composer.json file in /
0.509 To initialize a project, please create a composer.json file. See https://getcomposer.org/basic-usage
------
Dockerfile:6
--------------------
   4 |     COPY ./dockerizer/vhost.conf /opt/docker/etc/nginx/vhost.conf
   5 |     COPY composer.json composer.lock /app/
   6 | >>> RUN composer install --no-interaction --no-scripts --no-suggest
   7 |     COPY . /app
   8 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c composer install --no-interaction --no-scripts --no-suggest" did not complete successfully: exit code: 1

dedfft avatar May 10 '24 16:05 dedfft

Screen 2024-05-10 at 19 14 32@2x

dedfft avatar May 10 '24 16:05 dedfft

Same Here

channchetra avatar Jun 12 '24 09:06 channchetra

My solution. Add this line in Dockerfile.

WORKDIR /app

Completed Dockerfile

FROM webdevops/php-nginx:8.2-alpine
WORKDIR /app
COPY ./dockerizer/php.ini /opt/docker/etc/php/php.ini
COPY ./dockerizer/vhost.conf /opt/docker/etc/nginx/vhost.conf
COPY composer.json composer.lock /app/
RUN composer install --no-interaction --no-scripts --no-suggest
COPY . /app

sizucen avatar Oct 02 '24 12:10 sizucen