Skip to content

Add --ignore-platform-reqs flag to Composer #26

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

Conversation

oranges13
Copy link
Contributor

@oranges13 oranges13 commented Apr 17, 2020

When using composer, the image may not have the required php extensions or modules to install successfully, so you have to manually pass the --ignore-platform-reqs flag each time.

Adding this to the entry point of the image means that you can just run docker-compose run composer without additional flags.

This avoids adding caveats to the documentation and adds to the "it just works" utility of docker.

When using composer, the image may not have the required php extensions or modules to install successfully, so you have to manually pass the --ignore-platform-reqs flag each time.

Adding this to the entry point of the image means that you can just run docker-compose run composer without additional flags.

This avoids adding caveats to the documentation and adds to the "it just works" utility of docker.
@aschmelyun
Copy link
Owner

@oranges13 Thanks for catching this, and good to know!

@aschmelyun aschmelyun merged commit f480e32 into aschmelyun:master Sep 6, 2020
@eli-s-r
Copy link

eli-s-r commented Sep 9, 2020

This fails when running composer commands that don't support the --ignore-platform-reqs option (such as prohibits)

@iKlsR
Copy link

iKlsR commented Sep 9, 2020

I think this should be added by the user if they see the need to. The only time I ever use this flag is on Windows after I've installed horizon as it needs to be in every composer call thereafter. In fact I switched to a *nix based docker image solely to avoid having to use this flag by means of aliasing or throwing into my composer file as it can cause other issues as evidenced above.

@oranges13
Copy link
Contributor Author

oranges13 commented Sep 9, 2020

The composer docker container by default won't have any additional PHP extensions loaded though and may fail when your composer.json requires them ( gd is a good example ).

Yes you could change the docker compose file to install composer on a *nix-based docker image, or copy the app image into a separate compare image but that kind of defeats the purpose that the repo author has designed. My opinion.

That kind of goes beyond the scope of this repo to begin with, which is supposed to be a starting off point for most projects I believe.

It is only really required for composer install /update though. Is there a different way to add that flag as a default for only those commands? Because otherwise it isn't necessarily obvious to everyone why it's failing especially people who maybe new to docker.

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

Successfully merging this pull request may close these issues.

4 participants