Framadate docker-compose issue: Prestissimo
Problem
Trying to run docker-compose up
from a fresh clone of the framadate develop
branch I get this error at step 11:
Step 11/18 : RUN set -eux; composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --classmap-authoritative; composer clear-cache
---> Running in cab9bbaa1556
+ composer global require hirak/prestissimo:^0.3 --prefer-dist --no-progress --no-suggest --classmap-authoritative
Changed current directory to /root/.composer
You are using the deprecated option "--no-suggest". It has no effect and will break in Composer 3.
[RuntimeException]
No composer.json present in the current directory, this may be the cause of the following exception.
[InvalidArgumentException]
Package hirak/prestissimo at version ^0.3 has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version
require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>]...
ERROR: Service 'framadate' failed to build: The command '/bin/sh -c set -eux; composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --classmap-authoritative; composer clear-cache' returned a non-zero code: 1
Workaround
I investigated this and found that prestissimo is unnecessary since the launch of composer 2. So my 'workaround' was to change one thing in the Dockerfile
:
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
to
COPY --from=composer:1.10 /usr/bin/composer /usr/bin/composer
Downgrading to composer 1.10
Solution idea
Someone who knows PHP and composer better than me could remove the prestissimo dependency entirely and keep composer 2, which the community actually says results in faster builds: https://github.com/hirak/prestissimo/issues/233