Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update composer to 2.0 #2760

Open
phoenixg opened this issue Oct 31, 2020 · 7 comments
Open

Update composer to 2.0 #2760

phoenixg opened this issue Oct 31, 2020 · 7 comments

Comments

@phoenixg
Copy link

Changed current directory to /home/laradock/.composer
Warning from https://repo.packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2

@pjotrsavitski
Copy link

pjotrsavitski commented Nov 5, 2020

There doesn't seem to be any version setting for composer, meaning that the latest one will be used at build time.

Just try to rebuilt your workspace container running docker-compose build --no-cache workspace as it is documented here.

Another way would be to update the composer version within a container by running composer self-update --2 and have that switched for you.

The version will switch automatically next time you rebuild a container, though it will still be at 1.x if you keep using the same one that you've built some time ago.

@phoenixg
Copy link
Author

phoenixg commented Nov 6, 2020

@pjotrsavitski Thank you very much bro.

@glorand
Copy link
Contributor

glorand commented Nov 12, 2020

after I rebuild the workspace with --no-cache still have version 1 installed: Composer version 1.10.5 2020-04-10 11:44:221
running composer self-update --2 got an error message:
[ErrorException] rename(/home/laradock/.composer/cache/composer-temp.phar,/usr/local/bin/composer): Permission denied

@pjotrsavitski
Copy link

pjotrsavitski commented Nov 12, 2020

@glorand It is strange that rebuilding a container did not work for you. Not sure how to help with that as it worked just fine for me. Maybe someone with better understanding and deeper knowledge of the inner workings will be able to help.

As for the error you have mentioned, it might depend on the user that you ssh into the container with. You might either be a root or run the command with sudo (the second possibility does not seem to be there, at least not for me).

Example: docker-compose exec --user=laradock workspace bash

This line will ssh into that container with shell set to bash and user laradock. That user is not the root, so the possibilities might be somewhat limited.

If you try it without specifying a user docker-compose exec workspace bash, then you should be a root with all the rights you need.

@glorand
Copy link
Contributor

glorand commented Nov 12, 2020

@pjotrsavitski thanks for your detailed answer. Was my bad, before a no cache rebuild need to stop all running containers. I can confirm that docker-compose build --no-cache workspace installs the latest version of composer

@godbout
Copy link

godbout commented Nov 29, 2020

for those who still don't get composer 2 even after a build --no-cache make sure you pull the latest laradock/workspace image you need 😎️

@bestlong
Copy link
Member

#2817
#2982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants