Closed samundra closed 6 years ago
To be able to run Composer on any PHP, you'll need the following PHP extensions:
And also some other recommended packages in general Linux systems (full complete list):
The composer package from PHP.earth Alpine installs PHP extensions automatically (apk add --no-cache composer
)
Otherwise also this will work:
apk add --no-cache php7.1-phar
curl -sS https://getcomposer.org/installer|php
I'll write more docs on this and check if it can be simplified more. Thanks @samundra for reporting issues.
@petk Thanks for the mentioned packages. I had to use apk add --no-cache composer
to finally use composer. I found that it tries to get the latest version which is nice. However I thought I could install it out of the box and was surprised when it didn't.
I think, we should add phar packages by default to our docker boxes.
I agree. Phar is sort of essential extension and doesn't add too much to the Docker image (0.3MB ATM). Added via 5c06d4ec1a80958f0f9ee986a0dc23f7cbf2a98d
I'll leave this opened until I fix the Composer docs chapter also...
Docker & Composer chapter has been updated: https://php.earth/docs/docker/composer with some more info and usage examples. Closing this. In case there's more that needs to be explained, let me know...
I tried to install composer the usual way from inside the container but it failed with error message.
Docker container:
phpearth/php:7.1-cli
Installation Command
Error reported by the system.
build docker container based on
7.1-cli
tag and try to install composer manually. I tried to do a manual installation so that I can have the latest version of composer but it failed with above error message.For now I have used the alpine packaged composer version.