yiisoft / yii2-docker

Official Docker images suitable for Yii 2.0
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
384 stars 202 forks source link

add parametrized composer version #116

Closed Insolita closed 2 years ago

Insolita commented 3 years ago

Allow composer 2.x version by env/arg

Insolita commented 3 years ago

Can add pr

schmunk42 commented 3 years ago

Since fxp asset-plugin is not compatible with v2 yet I'd wait until https://github.com/fxpio/composer-asset-plugin/issues/334 is ready.

I'd then switch completely to v2, instead of builiding another 3-4 images.

Insolita commented 3 years ago

That issue not solved for more than half of the year, and I'm not sure that anybody works on this. As a fact composer-asset-plugin mostly required for old yii versions only. The newest ones work perfectly with asset-packagist.org So, for 2.x we can skip its installation (and hirak/prestissimo too)

schmunk42 commented 3 years ago

@Insolita Could you try adding

RUN composer self-update

to your Dockerfile and see if things are working OK for you?

We, for example, are still using fxp/asset-plugin for most of our projects, because in many of our projects we run into memory issues with asset-packagist (depends on the packages you use).

Insolita commented 3 years ago

I also remove "hirak/prestissimo" before update composer version. It works well.

Do you think about the switch to https://github.com/fxpio/foxy with https://github.com/krissss/foxy-yii2-convert ?

I understand that there are many different use cases for this image, so I think that the building parameter that declared which major composer version should be used is the best decision. In our latest yii2 projects we use asset-packagist without problems

schmunk42 commented 3 years ago

I also remove "hirak/prestissimo" before update composer version. It works well.

Yes, no longer needed, parallelization is built in composer v2.

anasjaghoub commented 3 years ago

I fixed it by adding RUN composer self-update --2 to the Dockerfile

schmunk42 commented 2 years ago

We have composer 2 on the Docker images since a while.