Hi, I remember in this community slack were some d...
# docker
r
Hi, I remember in this community slack were some discussions connected with upgrade to composer 2 version, but now I can’t find them, I think because of 10.000 slack messages history limit. Spryker, do you plan to upgrade composer to version 2 in docker images in near future? Currently we use docker/sdk with our own docker image (with several additional layers) based on this image https://github.com/spryker/docker-php/blob/master/alpine/3.12/7.3/Dockerfile But this parent image use composer 1.10.19 If composer won’t be upgraded in spryker image I see on our side at leat 2 solutions: 1. In our child image to upgrade composer from 1 to 2. 2. Create a clean image(s) from official php fpm alpine docker image and add only needed stuff (including composer 2) on our side (not using spryker base image).
a
@high-pencil-62400 has\had a reason not to switch to v2 yet.
👍 1
h
Yes. At the moment we started using Compose v2 it has a lot of issues.
👍 1
Now we reconsider again.
r
Thank you for the information, maybe we should also postpone the update then for some time. But I will at least check if it will work for our project.
w
We did the step a few days ago by extending the docker images in our project. So far it runs fine and we haven't come across issues. As we have a very high test coverage on integration level we are also pretty confident that the upgrade to composer 2.0 did not broke any package. Would be really interested in what are the issue were, so we might take a closer look at it.
👍 2
h
We got issues on early versions (probably before 2.0.6)
r
I think this line from docker file will not work: https://github.com/spryker/docker-php/blob/master/alpine/3.12/7.3/Dockerfile#L163
Copy code
RUN bash -c '[[ $(composer --version) == "1*" ]] && composer global require hirak/prestissimo && rm -rf /home/spryker/.composer/cache || true'
I additionally checked it in container and saw no global library
hirak/prestissimo
for composer version 1.10.19 1) As far as I remember asterisk symbol for wild card should be after quotes in bash Incorrect:
"1*"
Correct:
"1"*
2) But it also will not match because
$(composer --version)
will return “Composer version 1.10.19 2020-12-04 091416" what can’t be matched with pattern
"1"*
In this case this library won’t be installed. I think this version with variable from ARG COMPOSER_VERSION should work:
Copy code
RUN bash -c '[[ $COMPOSER_VERSION == "1"* ]] && composer global require hirak/prestissimo && rm -rf /home/spryker/.composer/cache || true'
s
@wooden-dress-65386 @mammoth-painting-63509
h
@orange-book-10869, please, check the assumption provided by @rapid-night-92661. Thanks. cc @acoustic-orange-45969
@rapid-night-92661, thank you very much for the findings. I will drive the update to Composer v2 asap.
👍 1
The fix with prestissimo was merged and new images are fixed now.
👍 1
Composer v2 is still under consideration.