Skip to content

Commit

Permalink
Fixes #248 Added grpc extension
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Nov 30, 2022
1 parent 6e15be1 commit 0c93ca7
Show file tree
Hide file tree
Showing 16 changed files with 179 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .ansible/group_vars/all/mods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ extensions_enabled:
- gd
- gettext
- gmp
- grpc
- hash
- iconv
- igbinary
Expand Down Expand Up @@ -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 }}"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/mods/Dockerfile-7.0
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libyaml-dev \
libz-dev \
libzip-dev \
re2c \
snmp \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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$' \
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/mods/Dockerfile-7.1
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libyaml-dev \
libz-dev \
libzip-dev \
re2c \
snmp \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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$' \
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/mods/Dockerfile-7.2
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libyaml-dev \
libz-dev \
libzip-dev \
re2c \
snmp \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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$' \
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/mods/Dockerfile-7.3
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libyaml-dev \
libz-dev \
libzip-dev \
re2c \
snmp \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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$' \
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/mods/Dockerfile-7.4
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libyaml-dev \
libz-dev \
libzip-dev \
re2c \
snmp \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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$' \
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/mods/Dockerfile-8.0
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libyaml-dev \
libz-dev \
libzip-dev \
re2c \
snmp \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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$' \
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/mods/Dockerfile-8.1
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libyaml-dev \
libz-dev \
libzip-dev \
re2c \
snmp \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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$' \
Expand Down
14 changes: 14 additions & 0 deletions Dockerfiles/mods/Dockerfile-8.2
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libyaml-dev \
libz-dev \
libzip-dev \
snmp \
unixodbc-dev \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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$' \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down
16 changes: 16 additions & 0 deletions doc/php-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,22 @@ The following PHP modules are available on the `mods`, `prod` and `work` flavour
<td class="ext_mods_gmp_8.1">🗸</td>
<td class="ext_mods_gmp_8.2">🗸</td>
</tr>
<tr>
<td><a href="../php_modules/grpc">grpc</a></td>
<td class="ext_mods_grpc_5.2"></td>
<td class="ext_mods_grpc_5.3"></td>
<td class="ext_mods_grpc_5.4"></td>
<td class="ext_mods_grpc_5.5"></td>
<td class="ext_mods_grpc_5.6"></td>
<td class="ext_mods_grpc_7.0">🗸</td>
<td class="ext_mods_grpc_7.1">🗸</td>
<td class="ext_mods_grpc_7.2">🗸</td>
<td class="ext_mods_grpc_7.3">🗸</td>
<td class="ext_mods_grpc_7.4">🗸</td>
<td class="ext_mods_grpc_8.0">🗸</td>
<td class="ext_mods_grpc_8.1">🗸</td>
<td class="ext_mods_grpc_8.2">🗸</td>
</tr>
<tr>
<td><a href="../php_modules/hash">hash</a></td>
<td class="ext_mods_hash_5.2">🗸</td>
Expand Down
8 changes: 8 additions & 0 deletions php_modules/grpc/README.md
Original file line number Diff line number Diff line change
@@ -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 |
10 changes: 10 additions & 0 deletions php_modules/grpc/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---

# Available Jinja2 variables:
# ---------------------------
# * {{ php_all_versions }}: Array of all PHP versions


all:
type: pecl
build_dep: [libz-dev]
24 changes: 24 additions & 0 deletions php_modules/grpc/options.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions php_modules/grpc/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---

0 comments on commit 0c93ca7

Please sign in to comment.