grpc/src/php/docker
Stanley Cheung 18af795edf Update min PHP testing version from PHP 7.4 to 8.1 (#35964)
- PHP 7.4 and 8.0 have been EOL https://www.php.net/supported-versions.php
- See go/drop-php-8.0 for more details

Most of the changes came from `generate_projects.sh` after updating the `tools/buildgen/plugins/expand_version.py` file. The change to `tools/internal_ci/helper_scripts/prepare_build_macos_rc` is manual.

Closes #35964

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35964 from stanley-cheung:php-update-to-8_1 0c24c4eac2
PiperOrigin-RevId: 609495798
2024-02-22 14:32:42 -08:00
..
alpine Update min PHP testing version from PHP 7.4 to 8.1 (#35964) 2024-02-22 14:32:42 -08:00
centos7 Update min PHP testing version from PHP 7.4 to 8.1 (#35964) 2024-02-22 14:32:42 -08:00
fork-support PHP: add various scenarios to test PECL extension 2019-10-01 14:39:48 -07:00
grpc-ext Update min PHP testing version from PHP 7.4 to 8.1 (#35964) 2024-02-22 14:32:42 -08:00
grpc-src Update min PHP testing version from PHP 7.4 to 8.1 (#35964) 2024-02-22 14:32:42 -08:00
i386 Update min PHP testing version from PHP 7.4 to 8.1 (#35964) 2024-02-22 14:32:42 -08:00
php-src Update min PHP testing version from PHP 7.4 to 8.1 (#35964) 2024-02-22 14:32:42 -08:00
php-zts Update min PHP testing version from PHP 7.4 to 8.1 (#35964) 2024-02-22 14:32:42 -08:00
php8.2 PHP: update version, php 8.2 is released (#32078) 2023-01-11 13:25:35 -08:00
README.md Replace disrespectful words 2021-02-08 14:29:18 -08:00

README.md

Docker Images for Testing

This directory contains a number of docker images to assist testing the gRPC PECL extension against various different PHP environments.

Build and Run Tests

$ cd grpc

To build all docker images:

$ ./src/php/bin/build_all_docker_images.sh

Or to only build some selected images

$ ./src/php/bin/build_all_docker_images.sh grpc-ext php-src

Or to only print out individual docker build commands

$ ./src/php/bin/build_all_docker_images.sh --cmds

To run all tests:

$ ./src/php/bin/run_all_docker_images.sh

Or to only run some selected images

$ ./src/php/bin/run_all_docker_images.sh grpc-ext php-src

Or to only print out individual docker run commands

$ ./src/php/bin/run_all_docker_images.sh --cmds

Build and Run Specified Image

grpc-ext

This image builds the full grpc PECL extension (effectively the current release candidate), installs it against the current PHP version, and runs the unit tests.

Build grpc-ext docker image:

$ cd grpc
$ docker build -t grpc-php/grpc-ext -f ./src/php/docker/grpc-ext/Dockerfile .

Run image:

$ docker run -it --rm grpc-php/grpc-ext

grpc-src

This image builds the grpc PECL extension in a 'thin' way, only containing the gRPC extension source files. The gRPC C Core library is expected to be installed separately and dynamically linked. The extension is installed against the current PHP version.

This also allows us to compile our grpc extension with some additional configure options, like --enable-tests, which allows some additional unit tests to be run.

Build grpc-src docker image:

$ cd grpc
$ docker build -t grpc-php/grpc-src -f ./src/php/docker/grpc-src/Dockerfile .

Run image:

$ docker run -it --rm grpc-php/grpc-src

alpine

This image builds the grpc extension against the current PHP version in an Alpine-Linux base image.

Build alpine docker image:

$ cd grpc
$ docker build -t grpc-php/alpine -f ./src/php/docker/alpine/Dockerfile .

Run image:

$ docker run -it --rm grpc-php/alpine

centos7

This image builds the grpc extension against the GCC version in Centos7 base image. The default version of gcc in centos7 is gcc-4.8.5. Run scl enable devtoolset-7 bash command to enable gcc-7.3.1.

Build centos7 docker image:

$ cd grpc
$ docker build -t grpc-gcc7/centos -f ./src/php/docker/centos7/Dockerfile .

Run image:

$ docker run -it --rm grpc-gcc7/centos

php-src

Instead of using a general purpose base docker image provided by PHP, here we compile PHP itself from source. This will allow us to change some configure options, like --enable-debug. Then we proceed to build the full grpc PECL extension and run the unit tests.

Build php-src docker image:

$ cd grpc
$ docker build -t grpc-php/php-src -f ./src/php/docker/php-src/Dockerfile .

Run image:

$ docker run -it --rm grpc-php/php-src

php-zts

This image builds the grpc extension against the current PHP version with ZTS enabled.

Build php-zts docker image:

$ cd grpc
$ docker build -t grpc-php/php-zts -f ./src/php/docker/php-zts/Dockerfile .

Run image:

$ docker run -it --rm grpc-php/php-zts

php-future

This image builds the grpc extension against the next future PHP version currently in alpha, beta or release candidate stage.

Build php-future docker image:

$ cd grpc
$ docker build -t grpc-php/php-future -f ./src/php/docker/php-future/Dockerfile .

Run image:

$ docker run -it --rm grpc-php/php-future

php5

NOTE: PHP 5.x has reached the end-of-life state and is no longer supported.

fork-support

This image tests pcntl_fork() support and makes sure scripts using pcntl_fork() don't freeze or crash.

Build grpc-ext docker image:

$ cd grpc
$ docker build -t grpc-php/fork-support -f ./src/php/docker/fork-support/Dockerfile .

Run image:

$ docker run -it --rm grpc-php/fork-support