You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I just want to inform, that placing composer service is not a good idea if you recommend to run the project via docker-compose up. It'll make both containers run, and files in vendor will be duplicated and we'll have warnings like this: Warning: Ambiguous class resolution, "PharIo\Manifest\BundlesElement" was found in both "/opt/php/vendor/phar-io/manifest/src/xml/BundlesElement.php" and "/opt/php/vendor/phar-io/manifest/src/src/xml/BundlesElement.php", the first will be used.
It'll only happen when running it 1st time.
I'm not making a PR, because I'm not sure what the solution should be.
Easiest approaches:
In documentation just recommend to run project via docker-compose up php
Just remove composer service, and recommend to run it via docker run --rm. This might be good idea, since sometimes tty/interactive might be needed. Also current composer implementation in docker-compose.yml is not passing ssh-agent into container (https://hub.docker.com/_/composer/)
This will make composer service to return 0 immediately, so it'll not make duplicates in vendor.
But still - I'm not sure, if docker-compose should contain services which does nothing on docker-compose up
Other way is to have separate docker-compose.yml files for those services, but then it will be harder to execute them eg: docker-compose -f docker-compose.composer.yml run composer install
Unfortunately docker-compose doesn't provide a way to wait until other container finish. There is potential hack - remove composer part from test_runner.sh and then add composer service in depends_on, and in test_runner.sh ping composer service until it's down and then proceed.
The text was updated successfully, but these errors were encountered:
9910fdf should solve this issue. There is only one service in docker-compose.yml that runs Composer, cs and test via make now, so everything can be run using make (Sphinx build for readthedocs documentation is build using make, too).
Hi,
I just want to inform, that placing
composer
service is not a good idea if you recommend to run the project viadocker-compose up
. It'll make both containers run, and files in vendor will be duplicated and we'll have warnings like this:Warning: Ambiguous class resolution, "PharIo\Manifest\BundlesElement" was found in both "/opt/php/vendor/phar-io/manifest/src/xml/BundlesElement.php" and "/opt/php/vendor/phar-io/manifest/src/src/xml/BundlesElement.php", the first will be used.
It'll only happen when running it 1st time.
I'm not making a PR, because I'm not sure what the solution should be.
Easiest approaches:
docker-compose up php
docker run --rm
. This might be good idea, since sometimes tty/interactive might be needed. Also currentcomposer
implementation indocker-compose.yml
is not passing ssh-agent into container (https://hub.docker.com/_/composer/)There is a hack also:
This will make
composer
service to return 0 immediately, so it'll not make duplicates in vendor.But still - I'm not sure, if docker-compose should contain services which does nothing on
docker-compose up
Other way is to have separate docker-compose.yml files for those services, but then it will be harder to execute them eg:
docker-compose -f docker-compose.composer.yml run composer install
Unfortunately docker-compose doesn't provide a way to wait until other container finish. There is potential hack - remove composer part from
test_runner.sh
and then addcomposer
service independs_on
, and intest_runner.sh
pingcomposer
service until it's down and then proceed.The text was updated successfully, but these errors were encountered: