I’m running this command inside of my Dockerfile via the RUN command. This seems like it should work but errors instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RUN if [ ! -d "../vendor" ]; then \ | |
| curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer && \ composer install && rm $(which composer) \ | |
| ;fi |
I haven’t spent the time to figure out exactly why, so to fix (by fix i mean hack) this I just simply created two RUN commands like this:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| RUN if [ ! -d "$PWD/vendor" ]; then \ | |
| curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \ | |
| ;fi | |
| RUN if [ ! -d "$PWD/vendor" ]; then \ | |
| composer install && rm $(which composer) \ | |
| ;fi |
I could probably check to see if the composer package is installed instead of checking if the directory is there when running the composer download shell command.
