Skip to content

composer inside docker container in the application's directory crashes. #780

@TheNewSound

Description

@TheNewSound

Describe the bug
When running / executing the composer binary inside the InvoiceNinja docker container, it throws an error message:

PHP Fatal error:  Declaration of Symfony\Component\Console\Command\HelpCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Command\Command::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in phar:///usr/local/bin/composer/vendor/symfony/console/Command/HelpCommand.php on line 70

This problem may be unrelated to the actual invoiceninja build, however its worth to note that the execution of composer inside the container also does not work for other directories than the application directory at /var/www/html. After some further digging it also turns out that the scripts: section of the invoiceninja composer.json is triggering this specific error. When I remove all members of the scripts: section after the dump autoload command, the composer --version command works again. But other composer commands still throws errors.

To reproduce
Steps to reproduce the behavior:

  1. build the invoiceninja container using this dockerfile.
  2. try to execute the composer command inside the container via a terminal.
  3. error message appears.

Expected behavior
I should be able to use the composer command inside the docker container.

Related issue
composer/composer#12514

Solution
Disable opcache in cli

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions