1

I have made a docker compose file with three services web( nginx service) app(php-laravel-folder-service) database(mysal-service) for every service i create a dockerfile web.dockerfile app.dockerfile database.dockerfile.

The problem is: in the app.dockerfile i want to install composer and execute the composer install command or php composer.phar install command and every time i got this error: ERROR: Service 'app' failed to build: The command '/bin/sh -c composer.phar install' returned a non-zero code: 12

2
  • try to rename it Commented Mar 11, 2018 at 14:40
  • Rename the composer.phar file ?? because i did move it to the /bin folder but it stil dosn't work and i also grap the composer/composer from the docker HUB this work but the version of php is lower from the version that laravel required . Commented Mar 11, 2018 at 14:45

1 Answer 1

2

Try moving the composer.phar to /usr/local/bin/ this will allow you to call the composer globally. It would look something like this in your Dockerfile. Just make sure you are running this with your working directory set as your apps root

RUN curl -sS https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer RUN composer install 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.