devcontainers / features

A collection of Dev Container Features managed by Dev Container spec maintainers. See https://github.com/devcontainers/feature-starter to publish your own
https://containers.dev/features
MIT License
922 stars 374 forks source link

[PHP] Reuse build files from setup-php action #262

Open shyim opened 2 years ago

shyim commented 2 years ago

Currently, the PHP feature builds PHP from source code which can take a while and does not contain any PHP extension.

Maybe it makes sense here to reuse the build binaries from the popular setup-php action:

https://github.com/shivammathur/php-builder/releases

So instead of building it from source, we download the tar and unpack it

bamurtaugh commented 1 year ago

Thanks for opening @shyim! If you have a proposed change in mind, please feel free to open a PR in this repo, and you can link this issue.

shyim commented 1 year ago

Hey @bamurtaugh ,

I build it meanwhile by my own. Are there interest to get it to here?

https://github.com/shyim/devcontainers-features/tree/main/src/php

bamurtaugh commented 1 year ago

Thanks for sharing! Please feel free to open a PR to add custom Features you create to our index: https://github.com/devcontainers/devcontainers.github.io/blob/gh-pages/_data/collection-index.yml. This list backs the Features we list on our spec site https://containers.dev/features.

cc @samruddhikhandale @joshspicer if you have any thoughts on modifying the existing php Feature vs adding this as a new community one.

samruddhikhandale commented 1 year ago

Using a PHP binary instead of building from source has many advantages, we should definitely do that at some point. For Python, we already have a similar issue open - https://github.com/devcontainers/features/issues/75

However, we'll need to either setup our own repo which builds binaries or find a secure/trusted one. The one mentioned in the OP looks decent, but we may want to consider security/support/maintainabiliry before switching to binaries built from a personal repo.

shyim commented 1 year ago

It would make more sense to support him https://github.com/shivammathur/setup-php. His action is like the standard way to Set up PHP in GitHub Actions. 73k repos depend on that 😅