-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Allow disabling cache via command line #7895
Comments
I do not understand how Docker is "a very valid" use-case. I use Docker extensively and the Composer cache is not an issue, especially since multi-stage builds were introduced. Your production container should only contain your build artifact, there shouldn't be anything related to Composer inside of it if you are doing it right. |
Already solved in pull request #7880 Feel free to review the code and mark it as approved if you think it makes sense. That would bring it closer to release. |
The above can already be achieved by running, just FYI
|
I agree, but following the discussion in #6650 and more specifically - your comment (#6650 (comment)), I was under the impression that such a feature will be useful. @Fleshgrinder correctly pointed out in his comment
I believe that having this feature as "built-in" AND crossplatform out of the box, is much better than resorting to undocumented tricks with setting environment variables in the command line. |
environment variables supported by Composer are documented: https://getcomposer.org/doc/03-cli.md#environment-variables |
Indeed, they are documented and they are also cross platform.. anyway, a flag that does exactly the same does not hurt I guess. It's only a few lines of code. And if it makes some people happy for some reason, that's a win I guess 🤷♂️ |
Fixed by #7880 |
Re-open of #1896
There is a very valid use case for wanting to completely disable the cache - Docker.
Best practices for building slim Docker images are to disable or clear caches for all package managers. There is absolutely zero benefit from having cached packages in a Docker image, it just consumes space.
We can of course delete the cache files after in a seperate command - however it seems pretty standard for modern package managers to now offer this as a CLI option, see: PIP, APK, Yarn is also looking at implementing it.
The text was updated successfully, but these errors were encountered: