What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hi, I remember in this community slack were some discussions connected with upgrade to composer 2 ve

UT4U1HEHG
UT4U1HEHG Posts: 49 🧑🏻‍🚀 - Cadet
edited February 2021 in Docker

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).

Comments

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    @ULYHPR789 has\had a reason not to switch to v2 yet.

  • sprymiker
    sprymiker Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    Yes. At the moment we started using Compose v2 it has a lot of issues.

  • sprymiker
    sprymiker Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited February 2021

    Now we reconsider again.

  • UT4U1HEHG
    UT4U1HEHG Posts: 49 🧑🏻‍🚀 - Cadet
    edited February 2021

    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.

  • Alberto Reyer
    Alberto Reyer Posts: 690 🪐 - Explorer

    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.

  • sprymiker
    sprymiker Sprykee Posts: 781 🧑🏻‍🚀 - Cadet
    edited February 2021

    We got issues on early versions (probably before 2.0.6)

  • UT4U1HEHG
    UT4U1HEHG Posts: 49 🧑🏻‍🚀 - Cadet
    edited February 2021

    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

    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 09:14:16" 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:

    RUN bash -c '[[ $COMPOSER_VERSION == "1"* ]] && composer global require hirak/prestissimo && rm -rf /home/spryker/.composer/cache || true'
    
  • U0134CBTUKS
    U0134CBTUKS Posts: 42 🧑🏻‍🚀 - Cadet
    edited February 2021
  • sprymiker
    sprymiker Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    @U01LP0UK75M, please, check the assumption provided by @UT4U1HEHG. Thanks.
    cc @URVTNBDQV

  • sprymiker
    sprymiker Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    @UT4U1HEHG, thank you very much for the findings. I will drive the update to Composer v2 asap.

  • sprymiker
    sprymiker Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    The fix with prestissimo was merged and new images are fixed now.

  • sprymiker
    sprymiker Sprykee Posts: 781 🧑🏻‍🚀 - Cadet

    Composer v2 is still under consideration.