Thank you for considering contributing to this project! Here's how you can help.
When a new PHP version is released:
-
Update
versions.jsonto include the new version:{ "php_versions": [ "8.1", "8.2", "8.3", "8.4", "8.5", "8.6" // Add new version here ], ... } -
The GitHub Actions workflow will automatically build images for the new version.
Some PHP versions may require special handling if GRPC doesn't build with the standard method:
PHP 8.5 Example: Currently uses a fallback build from grpc/grpc PR #40337.
The workflow automatically:
- First tries building with the standard
Dockerfile.template - If that fails, falls back to
Dockerfile.php85which builds GRPC from the PR - Once the PR is merged and released, the standard build will work automatically
To add special handling for a new version:
- Create a version-specific Dockerfile (e.g.,
Dockerfile.php86) - Update
.github/workflows/build-and-push.ymlto add similar conditional logic - Document the special handling in README.md
To add support for a new PHP variant (e.g., fpm-alpine3.19):
-
Update
versions.json:{ ... "variants": [ "cli", "fpm", "apache", "cli-alpine", "fpm-alpine", "fpm-alpine3.19" // Add new variant here ] } -
Test locally:
./build.sh 8.3 fpm-alpine3.19
To add more PHP extensions beyond GRPC:
-
Edit
Dockerfile.template:RUN ( curl -sSLf https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - || echo 'return 1' ) | sh -s \ grpc \ protobuf \ redis
-
Update the README to document the new extensions.
Before submitting a PR:
-
Build an image locally:
./build.sh 8.3 cli
-
Test that GRPC works:
docker run --rm ghcr.io/clegginabox/php-grpc:8.3-cli php -m | grep grpc -
Test a specific variant:
docker run --rm ghcr.io/clegginabox/php-grpc:8.3-fpm php --ri grpc
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Test locally using
./build.sh - Commit your changes:
git commit -am 'Add new feature' - Push to the branch:
git push origin feature/your-feature - Create a Pull Request
The repository uses two main workflows:
- build-and-push.yml: Runs daily to check for new PHP versions and builds/pushes images
- test.yml: Runs on PRs to test that images build successfully
If you find a bug or have a suggestion:
- Check if an issue already exists
- If not, create a new issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- PHP version and variant affected
Feel free to open an issue for any questions about contributing!