From 0c93ca7c9ddc5daba8900de17c66c991746b10b9 Mon Sep 17 00:00:00 2001 From: cytopia Date: Thu, 1 Dec 2022 00:38:42 +0100 Subject: [PATCH] Fixes #248 Added grpc extension --- .ansible/group_vars/all/mods.yml | 6 ++++++ CHANGELOG.md | 1 + Dockerfiles/mods/Dockerfile-7.0 | 14 ++++++++++++++ Dockerfiles/mods/Dockerfile-7.1 | 14 ++++++++++++++ Dockerfiles/mods/Dockerfile-7.2 | 14 ++++++++++++++ Dockerfiles/mods/Dockerfile-7.3 | 14 ++++++++++++++ Dockerfiles/mods/Dockerfile-7.4 | 14 ++++++++++++++ Dockerfiles/mods/Dockerfile-8.0 | 14 ++++++++++++++ Dockerfiles/mods/Dockerfile-8.1 | 14 ++++++++++++++ Dockerfiles/mods/Dockerfile-8.2 | 14 ++++++++++++++ README.md | 1 + doc/php-modules.md | 16 ++++++++++++++++ php_modules/grpc/README.md | 8 ++++++++ php_modules/grpc/build.yml | 10 ++++++++++ php_modules/grpc/options.yml | 24 ++++++++++++++++++++++++ php_modules/grpc/test.yml | 1 + 16 files changed, 179 insertions(+) create mode 100644 php_modules/grpc/README.md create mode 100644 php_modules/grpc/build.yml create mode 100644 php_modules/grpc/options.yml create mode 100644 php_modules/grpc/test.yml diff --git a/.ansible/group_vars/all/mods.yml b/.ansible/group_vars/all/mods.yml index 2b8d3c87..9c5460d6 100644 --- a/.ansible/group_vars/all/mods.yml +++ b/.ansible/group_vars/all/mods.yml @@ -28,6 +28,7 @@ extensions_enabled: - gd - gettext - gmp + - grpc - hash - iconv - igbinary @@ -355,6 +356,11 @@ extensions_available: pre: ln /usr/include/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)/gmp.h /usr/include/ build_dep: [libgmp-dev] run_dep: [] # TODO: Ensure to add libgmp10 to each of the versions + grpc: + disabled: [5.2, 5.3, 5.4, 5.5, 5.6] + all: + type: pecl + build_dep: [libz-dev] hash: disabled: [] already_avail: "{{ php_all_versions }}" diff --git a/CHANGELOG.md b/CHANGELOG.md index f8259725..d9ee8f6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This is a massive restructuring release, which adds another layer on top of Ansi - Added mechanism to easily build custom images with custom set of PHP extensions - Added automated PHP extension dependency resolver (order of built is always correct) - Added Credit to contributors +- Added `grpc` extension [#248](https://github.com/devilbox/docker-php-fpm/issues/248) ### Changed - Split out PHP extensions into separate directories diff --git a/Dockerfiles/mods/Dockerfile-7.0 b/Dockerfiles/mods/Dockerfile-7.0 index 374deee6..abbe62db 100644 --- a/Dockerfiles/mods/Dockerfile-7.0 +++ b/Dockerfiles/mods/Dockerfile-7.0 @@ -52,6 +52,7 @@ RUN set -eux \ libxpm-dev \ libxslt-dev \ libyaml-dev \ + libz-dev \ libzip-dev \ re2c \ snmp \ @@ -212,6 +213,17 @@ RUN set -eux \ && true +# -------------------- Installing PHP Extension: grpc -------------------- +RUN set -eux \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install grpc \ + # Enabling + && docker-php-ext-enable grpc \ + && true + + # -------------------- Installing PHP Extension: igbinary -------------------- RUN set -eux \ # Installation: Generic @@ -1011,6 +1023,8 @@ RUN set -eux \ && php-fpm -m | grep -oiE '^gettext$' \ && php -m | grep -oiE '^gmp$' \ && php-fpm -m | grep -oiE '^gmp$' \ + && php -m | grep -oiE '^grpc$' \ + && php-fpm -m | grep -oiE '^grpc$' \ && php -m | grep -oiE '^hash$' \ && php-fpm -m | grep -oiE '^hash$' \ && php -m | grep -oiE '^iconv$' \ diff --git a/Dockerfiles/mods/Dockerfile-7.1 b/Dockerfiles/mods/Dockerfile-7.1 index 71d50970..2d941f64 100644 --- a/Dockerfiles/mods/Dockerfile-7.1 +++ b/Dockerfiles/mods/Dockerfile-7.1 @@ -52,6 +52,7 @@ RUN set -eux \ libxpm-dev \ libxslt-dev \ libyaml-dev \ + libz-dev \ libzip-dev \ re2c \ snmp \ @@ -212,6 +213,17 @@ RUN set -eux \ && true +# -------------------- Installing PHP Extension: grpc -------------------- +RUN set -eux \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install grpc \ + # Enabling + && docker-php-ext-enable grpc \ + && true + + # -------------------- Installing PHP Extension: igbinary -------------------- RUN set -eux \ # Installation: Generic @@ -1019,6 +1031,8 @@ RUN set -eux \ && php-fpm -m | grep -oiE '^gettext$' \ && php -m | grep -oiE '^gmp$' \ && php-fpm -m | grep -oiE '^gmp$' \ + && php -m | grep -oiE '^grpc$' \ + && php-fpm -m | grep -oiE '^grpc$' \ && php -m | grep -oiE '^hash$' \ && php-fpm -m | grep -oiE '^hash$' \ && php -m | grep -oiE '^iconv$' \ diff --git a/Dockerfiles/mods/Dockerfile-7.2 b/Dockerfiles/mods/Dockerfile-7.2 index 94c8e421..fc7de310 100644 --- a/Dockerfiles/mods/Dockerfile-7.2 +++ b/Dockerfiles/mods/Dockerfile-7.2 @@ -52,6 +52,7 @@ RUN set -eux \ libxpm-dev \ libxslt-dev \ libyaml-dev \ + libz-dev \ libzip-dev \ re2c \ snmp \ @@ -212,6 +213,17 @@ RUN set -eux \ && true +# -------------------- Installing PHP Extension: grpc -------------------- +RUN set -eux \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install grpc \ + # Enabling + && docker-php-ext-enable grpc \ + && true + + # -------------------- Installing PHP Extension: igbinary -------------------- RUN set -eux \ # Installation: Generic @@ -1022,6 +1034,8 @@ RUN set -eux \ && php-fpm -m | grep -oiE '^gettext$' \ && php -m | grep -oiE '^gmp$' \ && php-fpm -m | grep -oiE '^gmp$' \ + && php -m | grep -oiE '^grpc$' \ + && php-fpm -m | grep -oiE '^grpc$' \ && php -m | grep -oiE '^hash$' \ && php-fpm -m | grep -oiE '^hash$' \ && php -m | grep -oiE '^iconv$' \ diff --git a/Dockerfiles/mods/Dockerfile-7.3 b/Dockerfiles/mods/Dockerfile-7.3 index 89940e21..c0de276b 100644 --- a/Dockerfiles/mods/Dockerfile-7.3 +++ b/Dockerfiles/mods/Dockerfile-7.3 @@ -51,6 +51,7 @@ RUN set -eux \ libxpm-dev \ libxslt-dev \ libyaml-dev \ + libz-dev \ libzip-dev \ re2c \ snmp \ @@ -203,6 +204,17 @@ RUN set -eux \ && true +# -------------------- Installing PHP Extension: grpc -------------------- +RUN set -eux \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install grpc \ + # Enabling + && docker-php-ext-enable grpc \ + && true + + # -------------------- Installing PHP Extension: igbinary -------------------- RUN set -eux \ # Installation: Generic @@ -1009,6 +1021,8 @@ RUN set -eux \ && php-fpm -m | grep -oiE '^gettext$' \ && php -m | grep -oiE '^gmp$' \ && php-fpm -m | grep -oiE '^gmp$' \ + && php -m | grep -oiE '^grpc$' \ + && php-fpm -m | grep -oiE '^grpc$' \ && php -m | grep -oiE '^hash$' \ && php-fpm -m | grep -oiE '^hash$' \ && php -m | grep -oiE '^iconv$' \ diff --git a/Dockerfiles/mods/Dockerfile-7.4 b/Dockerfiles/mods/Dockerfile-7.4 index 533216c1..ca904731 100644 --- a/Dockerfiles/mods/Dockerfile-7.4 +++ b/Dockerfiles/mods/Dockerfile-7.4 @@ -51,6 +51,7 @@ RUN set -eux \ libxpm-dev \ libxslt-dev \ libyaml-dev \ + libz-dev \ libzip-dev \ re2c \ snmp \ @@ -211,6 +212,17 @@ RUN set -eux \ && true +# -------------------- Installing PHP Extension: grpc -------------------- +RUN set -eux \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install grpc \ + # Enabling + && docker-php-ext-enable grpc \ + && true + + # -------------------- Installing PHP Extension: igbinary -------------------- RUN set -eux \ # Installation: Generic @@ -998,6 +1010,8 @@ RUN set -eux \ && php-fpm -m | grep -oiE '^gettext$' \ && php -m | grep -oiE '^gmp$' \ && php-fpm -m | grep -oiE '^gmp$' \ + && php -m | grep -oiE '^grpc$' \ + && php-fpm -m | grep -oiE '^grpc$' \ && php -m | grep -oiE '^hash$' \ && php-fpm -m | grep -oiE '^hash$' \ && php -m | grep -oiE '^iconv$' \ diff --git a/Dockerfiles/mods/Dockerfile-8.0 b/Dockerfiles/mods/Dockerfile-8.0 index e748ef05..dfdf8dac 100644 --- a/Dockerfiles/mods/Dockerfile-8.0 +++ b/Dockerfiles/mods/Dockerfile-8.0 @@ -51,6 +51,7 @@ RUN set -eux \ libxpm-dev \ libxslt-dev \ libyaml-dev \ + libz-dev \ libzip-dev \ re2c \ snmp \ @@ -211,6 +212,17 @@ RUN set -eux \ && true +# -------------------- Installing PHP Extension: grpc -------------------- +RUN set -eux \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install grpc \ + # Enabling + && docker-php-ext-enable grpc \ + && true + + # -------------------- Installing PHP Extension: igbinary -------------------- RUN set -eux \ # Installation: Generic @@ -973,6 +985,8 @@ RUN set -eux \ && php-fpm -m | grep -oiE '^gettext$' \ && php -m | grep -oiE '^gmp$' \ && php-fpm -m | grep -oiE '^gmp$' \ + && php -m | grep -oiE '^grpc$' \ + && php-fpm -m | grep -oiE '^grpc$' \ && php -m | grep -oiE '^hash$' \ && php-fpm -m | grep -oiE '^hash$' \ && php -m | grep -oiE '^iconv$' \ diff --git a/Dockerfiles/mods/Dockerfile-8.1 b/Dockerfiles/mods/Dockerfile-8.1 index 705e8a43..be106380 100644 --- a/Dockerfiles/mods/Dockerfile-8.1 +++ b/Dockerfiles/mods/Dockerfile-8.1 @@ -51,6 +51,7 @@ RUN set -eux \ libxpm-dev \ libxslt-dev \ libyaml-dev \ + libz-dev \ libzip-dev \ re2c \ snmp \ @@ -197,6 +198,17 @@ RUN set -eux \ && true +# -------------------- Installing PHP Extension: grpc -------------------- +RUN set -eux \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install grpc \ + # Enabling + && docker-php-ext-enable grpc \ + && true + + # -------------------- Installing PHP Extension: igbinary -------------------- RUN set -eux \ # Installation: Generic @@ -960,6 +972,8 @@ RUN set -eux \ && php-fpm -m | grep -oiE '^gettext$' \ && php -m | grep -oiE '^gmp$' \ && php-fpm -m | grep -oiE '^gmp$' \ + && php -m | grep -oiE '^grpc$' \ + && php-fpm -m | grep -oiE '^grpc$' \ && php -m | grep -oiE '^hash$' \ && php-fpm -m | grep -oiE '^hash$' \ && php -m | grep -oiE '^iconv$' \ diff --git a/Dockerfiles/mods/Dockerfile-8.2 b/Dockerfiles/mods/Dockerfile-8.2 index dd993800..a8da511b 100644 --- a/Dockerfiles/mods/Dockerfile-8.2 +++ b/Dockerfiles/mods/Dockerfile-8.2 @@ -47,6 +47,7 @@ RUN set -eux \ libxpm-dev \ libxslt-dev \ libyaml-dev \ + libz-dev \ libzip-dev \ snmp \ unixodbc-dev \ @@ -192,6 +193,17 @@ RUN set -eux \ && true +# -------------------- Installing PHP Extension: grpc -------------------- +RUN set -eux \ + # Installation: Generic + # Type: PECL extension + # Default: Pecl command + && pecl install grpc \ + # Enabling + && docker-php-ext-enable grpc \ + && true + + # -------------------- Installing PHP Extension: igbinary -------------------- RUN set -eux \ # Installation: Generic @@ -909,6 +921,8 @@ RUN set -eux \ && php-fpm -m | grep -oiE '^gettext$' \ && php -m | grep -oiE '^gmp$' \ && php-fpm -m | grep -oiE '^gmp$' \ + && php -m | grep -oiE '^grpc$' \ + && php-fpm -m | grep -oiE '^grpc$' \ && php -m | grep -oiE '^hash$' \ && php-fpm -m | grep -oiE '^hash$' \ && php -m | grep -oiE '^iconv$' \ diff --git a/README.md b/README.md index 1b43c415..dbff1ceb 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,7 @@ The provided Docker images heavily rely on inheritance to guarantee smallest pos [`gd`](php_modules/gd/) [`gettext`](php_modules/gettext/) [`gmp`](php_modules/gmp/) +[`grpc`](php_modules/grpc/) [`hash`](php_modules/hash/) [`iconv`](php_modules/iconv/) [`igbinary`](php_modules/igbinary/) diff --git a/doc/php-modules.md b/doc/php-modules.md index 01900a54..27acfaa0 100644 --- a/doc/php-modules.md +++ b/doc/php-modules.md @@ -1012,6 +1012,22 @@ The following PHP modules are available on the `mods`, `prod` and `work` flavour 🗸 🗸 + + grpc + + + + + + 🗸 + 🗸 + 🗸 + 🗸 + 🗸 + 🗸 + 🗸 + 🗸 + hash 🗸 diff --git a/php_modules/grpc/README.md b/php_modules/grpc/README.md new file mode 100644 index 00000000..54770702 --- /dev/null +++ b/php_modules/grpc/README.md @@ -0,0 +1,8 @@ +# grpc + +A high performance, open source, general RPC framework that puts mobile and HTTP/2 first. + +| Platform | Url | +|----------|------------------------------------------------------------------| +| GitHub | https://github.com/grpc/grpc/tree/master/src/php | +| Pecl | https://pecl.php.net/package/gRPC | diff --git a/php_modules/grpc/build.yml b/php_modules/grpc/build.yml new file mode 100644 index 00000000..08394a30 --- /dev/null +++ b/php_modules/grpc/build.yml @@ -0,0 +1,10 @@ +--- + +# Available Jinja2 variables: +# --------------------------- +# * {{ php_all_versions }}: Array of all PHP versions + + +all: + type: pecl + build_dep: [libz-dev] diff --git a/php_modules/grpc/options.yml b/php_modules/grpc/options.yml new file mode 100644 index 00000000..6b8ea097 --- /dev/null +++ b/php_modules/grpc/options.yml @@ -0,0 +1,24 @@ +--- + +# The name of the module +name: grpc + +# Exclude module build/installation for the following PHP versions +exclude: [5.2, 5.3, 5.4, 5.5, 5.6] + +# In order for this module to built correctly against all dependencies, +# the following modules must have been built first. +depends_build: [] + +# In order for this module to function correctly, +# the following modules must be loaded before. +depends_load: [] + +# If the following PHP modules are loaded, this module will not behave as expected. +conflicts_load: [] + +# Enable this module by default via php.ini for PHP cli command? +enabled_php_cli: true + +# Enable this module by default via php.ini for PHP-FPM? +enabled_php_fpm: true diff --git a/php_modules/grpc/test.yml b/php_modules/grpc/test.yml new file mode 100644 index 00000000..ed97d539 --- /dev/null +++ b/php_modules/grpc/test.yml @@ -0,0 +1 @@ +---