Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer:latest #49

Closed
Ilnytskyi-Oleh opened this issue Sep 22, 2023 · 4 comments
Closed

Composer:latest #49

Ilnytskyi-Oleh opened this issue Sep 22, 2023 · 4 comments

Comments

@Ilnytskyi-Oleh
Copy link

Greetings gentlemen!

First of all, I would like to express my gratitude for the excellent repository.
I encountered the following issue:

If the Dockerfile configuration specifies
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
the "make build" command fails with an

error
 ERROR [stage-0 19/19] RUN if [ "dev" = "dev  0.5s
------                                                
 > [stage-0 19/19] RUN if [ "dev" = "dev" ] || [ "dev" = "test" ]; then COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress;     else COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress --no-dev;     fi:
0.372 PHP Fatal error:  Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in phar:///usr/bin/composer/src/Composer/Config.php:191
0.372 Stack trace:
0.372 #0 phar:///usr/bin/composer/src/Composer/Config.php(191): array_merge(true, Array, true)
0.372 #1 phar:///usr/bin/composer/src/Composer/Factory.php(350): Composer\Config->merge(Array, './composer.json')
0.372 #2 phar:///usr/bin/composer/src/Composer/Factory.php(643): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), Array, false, '/var/www/html', true, false)
0.372 #3 phar:///usr/bin/composer/src/Composer/Console/Application.php(445): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, false, false)
0.372 #4 phar:///usr/bin/composer/src/Composer/Command/BaseCommand.php(65): Composer\Console\Application->getComposer(false, false, false)
0.372 #5 phar:///usr/bin/composer/src/Composer/Command/BaseCommand.php(150): Composer\Command\BaseCommand->getComposer(false, false, false)
0.372 #6 phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php(211): Composer\Command\BaseCommand->initialize(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #7 phar:///usr/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #8 phar:///usr/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Composer\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #9 phar:///usr/bin/composer/src/Composer/Console/Application.php(336): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #10 phar:///usr/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #11 phar:///usr/bin/composer/src/Composer/Console/Application.php(131): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #12 phar:///usr/bin/composer/bin/composer(73): Composer\Console\Application->run()
0.372 #13 /usr/bin/composer(29): require('phar:///usr/bin...')
0.372 #14 {main}
0.372   thrown in phar:///usr/bin/composer/src/Composer/Config.php on line 191
0.372 
0.372 Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, bool given in phar:///usr/bin/composer/src/Composer/Config.php:191
0.372 Stack trace:
0.372 #0 phar:///usr/bin/composer/src/Composer/Config.php(191): array_merge(true, Array, true)
0.372 #1 phar:///usr/bin/composer/src/Composer/Factory.php(350): Composer\Config->merge(Array, './composer.json')
0.372 #2 phar:///usr/bin/composer/src/Composer/Factory.php(643): Composer\Factory->createComposer(Object(Composer\IO\ConsoleIO), Array, false, '/var/www/html', true, false)
0.372 #3 phar:///usr/bin/composer/src/Composer/Console/Application.php(445): Composer\Factory::create(Object(Composer\IO\ConsoleIO), NULL, false, false)
0.372 #4 phar:///usr/bin/composer/src/Composer/Command/BaseCommand.php(65): Composer\Console\Application->getComposer(false, false, false)
0.372 #5 phar:///usr/bin/composer/src/Composer/Command/BaseCommand.php(150): Composer\Command\BaseCommand->getComposer(false, false, false)
0.372 #6 phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php(211): Composer\Command\BaseCommand->initialize(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #7 phar:///usr/bin/composer/vendor/symfony/console/Application.php(835): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #8 phar:///usr/bin/composer/vendor/symfony/console/Application.php(185): Symfony\Component\Console\Application->doRunCommand(Object(Composer\Command\InstallCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #9 phar:///usr/bin/composer/src/Composer/Console/Application.php(336): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #10 phar:///usr/bin/composer/vendor/symfony/console/Application.php(117): Composer\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #11 phar:///usr/bin/composer/src/Composer/Console/Application.php(131): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
0.372 #12 phar:///usr/bin/composer/bin/composer(73): Composer\Console\Application->run()
0.372 #13 /usr/bin/composer(29): require('phar:///usr/bin...')
0.372 #14 {main}
0.372   thrown in phar:///usr/bin/composer/src/Composer/Config.php on line 191
------
Dockerfile:89
--------------------
  88 |     # install all PHP dependencies
  89 | >>> RUN if [ "$BUILD_ARGUMENT_ENV" = "dev" ] || [ "$BUILD_ARGUMENT_ENV" = "test" ]; then COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress; \
  90 | >>>     else COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader --no-interaction --no-progress --no-dev; \
  91 | >>>     fi
  92 |     

However, if a specific version of Composer is specified, everything works as expected:
COPY --from=composer:2.6 /usr/bin/composer /usr/bin/composer

@dimadeush
Copy link
Collaborator

dimadeush commented Sep 24, 2023

Hello
We checked latest composer version and we can't emulate above error.
Composer version 2.6.3 2023-09-15 09:38:21
Please make sure that you are using our repository without changes on your side.
In addition we have integrated CI and we tried run it once again https://app.circleci.com/pipelines/github/systemsdk/docker-nginx-php-laravel/96/workflows/aa88ebc8-1d4c-4d20-9ed7-f928a60b7d05 - success.

@tarlepp
Copy link
Collaborator

tarlepp commented Sep 24, 2023

Maybe we should add simple version show to CI pipeline, something really simple like

php --version
composer --version
etc.

@dimadeush
Copy link
Collaborator

Will be added in next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants