Skip to content

Commit

Permalink
Merge pull request #7 from mlocati/master
Browse files Browse the repository at this point in the history
Fork Sync: Update from parent repository
  • Loading branch information
vdlp-mw authored Jun 26, 2023
2 parents cc8fcf9 + f5b3ab7 commit cbfe759
Show file tree
Hide file tree
Showing 6 changed files with 89 additions and 34 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/monitor-php8.2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ jobs:
- alpine3.15
- alpine3.16
- alpine3.17
- alpine3.18
- buster
- bullseye
- bookworm
name: Check on ${{ matrix.distro }}
runs-on: ubuntu-latest
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ jobs:
fail-fast: true
matrix:
distro:
- alpine3.7
- alpine3.8
- alpine3.9
- alpine3.10
- alpine3.11
Expand All @@ -73,10 +71,12 @@ jobs:
- alpine3.15
- alpine3.16
- alpine3.17
- alpine3.18
- jessie
- stretch
- buster
- bullseye
- bookworm
name: Check on ${{ matrix.distro }}
runs-on: ubuntu-latest
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-recent-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ jobs:
fail-fast: false
matrix:
distro:
- alpine3.7
- alpine3.8
- alpine3.9
- alpine3.10
- alpine3.11
Expand All @@ -48,10 +46,12 @@ jobs:
- alpine3.15
- alpine3.16
- alpine3.17
- alpine3.18
- jessie
- stretch
- buster
- bullseye
- bookworm
name: Check on ${{ matrix.distro }}
env:
IPETEST_DOCKER_DISTRO: ${{ matrix.distro }}
Expand Down
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ This repository contains a script that can be used to easily install a PHP exten

The script will install all the required APT/APK packages; at the end of the script execution, the no-more needed packages will be removed so that the image will be much smaller.

Supported docker images are all the Alpine/Debian versions, except for PHP 5.5 where we only support Debian 8 (jessie) (that is, `php:5.5`, `php:5.5-apache`, `php:5.5-cli`, `php:5.5-fpm`, `php:5.5-zts`).
Supported docker images are:

- Debian-based docker images: since jessie (Debian 8) (minimum PHP version: 5.5)
- Alpine-based docker images: since Alpine 3.9 (minimum PHP version: 7.1)

See also the notes in the [Special requirements](#special-requirements) section.

## Usage
Expand Down Expand Up @@ -241,7 +245,7 @@ install-php-extensions @fix_letsencrypt
| maxminddb | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| mcrypt | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memcache | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memcached | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memcached[*](#special-requirements-for-memcached) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| memprof[*](#special-requirements-for-memprof) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
| mongo | ✓ | ✓ | | | | | | | | |
| mongodb | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ |
Expand Down Expand Up @@ -411,20 +415,21 @@ Some extensions have special requirements:
<!-- ########################################################### -->
| Extension | Requirements |
|---|---|
| <a name="special-requirements-for-cassandra"></a>cassandra | &bull; Not available in `alpine3.7` docker images<br />&bull; Not available in `alpine3.8` docker images<br />&bull; Not available in `jessie` docker images<br />&bull; Not available in `stretch` docker images<br />&bull; Not available in `buster` docker images<br />&bull; Not available in `bullseye` docker images |
| <a name="special-requirements-for-ddtrace"></a>ddtrace | &bull; Not available in `alpine3.7` docker images<br />&bull; Not available in `alpine3.8` docker images<br />&bull; Not available in `jessie` docker images |
| <a name="special-requirements-for-geos"></a>geos | &bull; Not available in `alpine3.7` docker images<br />&bull; Not available in `alpine3.8` docker images<br />&bull; Not available in `alpine3.9` docker images<br />&bull; Not available in `alpine3.10` docker images |
| <a name="special-requirements-for-cassandra"></a>cassandra | &bull; Not available in `jessie` docker images<br />&bull; Not available in `stretch` docker images<br />&bull; Not available in `buster` docker images<br />&bull; Not available in `bullseye` docker images<br />&bull; Not available in `bookworm` docker images |
| <a name="special-requirements-for-ddtrace"></a>ddtrace | Not available in `jessie` docker images |
| <a name="special-requirements-for-geos"></a>geos | &bull; Not available in `alpine3.9` docker images<br />&bull; Not available in `alpine3.10` docker images |
| <a name="special-requirements-for-lz4"></a>lz4 | Not available in `jessie` docker images |
| <a name="special-requirements-for-memprof"></a>memprof | &bull; Not available in `alpine3.7` docker images<br />&bull; Not available in `alpine3.8` docker images<br />&bull; Not available in `alpine3.9` docker images<br />&bull; Not available in `alpine3.10` docker images<br />&bull; Not available in `alpine3.11` docker images<br />&bull; Not available in `alpine3.12` docker images<br />&bull; Not available in `alpine3.13` docker images<br />&bull; Not available in `alpine3.14` docker images<br />&bull; Not available in `alpine3.15` docker images |
| <a name="special-requirements-for-memcached"></a>memcached | Not available in `bookworm` docker images |
| <a name="special-requirements-for-memprof"></a>memprof | &bull; Not available in `alpine3.9` docker images<br />&bull; Not available in `alpine3.10` docker images<br />&bull; Not available in `alpine3.11` docker images<br />&bull; Not available in `alpine3.12` docker images<br />&bull; Not available in `alpine3.13` docker images<br />&bull; Not available in `alpine3.14` docker images<br />&bull; Not available in `alpine3.15` docker images |
| <a name="special-requirements-for-parallel"></a>parallel | Requires images with PHP compiled with thread-safety enabled (`zts`) |
| <a name="special-requirements-for-parle"></a>parle | Not available in `jessie` docker images |
| <a name="special-requirements-for-pdo_sqlsrv"></a>pdo_sqlsrv | &bull; Not available in `alpine3.7` docker images<br />&bull; Not available in `alpine3.8` docker images<br />&bull; Not available in ARM architectures |
| <a name="special-requirements-for-pdo_sqlsrv"></a>pdo_sqlsrv | Not available in ARM architectures |
| <a name="special-requirements-for-pthreads"></a>pthreads | Requires images with PHP compiled with thread-safety enabled (`zts`) |
| <a name="special-requirements-for-simdjson"></a>simdjson | &bull; Not available in `alpine3.7` docker images<br />&bull; Not available in `alpine3.8` docker images<br />&bull; Not available in `jessie` docker images<br />&bull; Not available in `stretch` docker images |
| <a name="special-requirements-for-simdjson"></a>simdjson | &bull; Not available in `jessie` docker images<br />&bull; Not available in `stretch` docker images |
| <a name="special-requirements-for-sodium"></a>sodium | Not available in `jessie` docker images |
| <a name="special-requirements-for-sqlsrv"></a>sqlsrv | &bull; Not available in `alpine3.7` docker images<br />&bull; Not available in `alpine3.8` docker images<br />&bull; Not available in `7.1-alpine3.9` docker images<br />&bull; Not available in `7.1-alpine3.10` docker images<br />&bull; Not available in ARM architectures |
| <a name="special-requirements-for-sqlsrv"></a>sqlsrv | &bull; Not available in `7.1-alpine3.9` docker images<br />&bull; Not available in `7.1-alpine3.10` docker images<br />&bull; Not available in ARM architectures |
| <a name="special-requirements-for-tensor"></a>tensor | &bull; Not available in `alpine3.15` docker images<br />&bull; Not available in `alpine3.16` docker images |
| <a name="special-requirements-for-vips"></a>vips | &bull; Not available in `alpine3.7` docker images<br />&bull; Not available in `alpine3.8` docker images<br />&bull; Not available in `alpine3.9` docker images<br />&bull; Not available in `jessie` docker images |
| <a name="special-requirements-for-vips"></a>vips | &bull; Not available in `alpine3.9` docker images<br />&bull; Not available in `jessie` docker images |
<!-- END OF SPECIAL REQUIREMENTS -->

### How do I know which Linux distribution I am using?
Expand Down
17 changes: 9 additions & 8 deletions data/special-requirements
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
cassandra !alpine3.7 !alpine3.8 !jessie !stretch !buster !bullseye
ddtrace !alpine3.7 !alpine3.8 !jessie
geos !alpine3.7 !alpine3.8 !alpine3.9 !alpine3.10
cassandra !jessie !stretch !buster !bullseye !bookworm
ddtrace !jessie
geos !alpine3.9 !alpine3.10
lz4 !jessie
memprof !alpine3.7 !alpine3.8 !alpine3.9 !alpine3.10 !alpine3.11 !alpine3.12 !alpine3.13 !alpine3.14 !alpine3.15
memcached !bookworm
memprof !alpine3.9 !alpine3.10 !alpine3.11 !alpine3.12 !alpine3.13 !alpine3.14 !alpine3.15
parallel zts
parle !jessie
pdo_sqlsrv !alpine3.7 !alpine3.8 !arm
pdo_sqlsrv !arm
pthreads zts
simdjson !alpine3.7 !alpine3.8 !jessie !stretch
simdjson !jessie !stretch
sodium !jessie
sqlsrv !alpine3.7 !alpine3.8 !7.1-alpine3.9 !7.1-alpine3.10 !arm
sqlsrv !7.1-alpine3.9 !7.1-alpine3.10 !arm
tensor !alpine3.15 !alpine3.16
vips !alpine3.7 !alpine3.8 !alpine3.9 !jessie
vips !alpine3.9 !jessie
71 changes: 59 additions & 12 deletions install-php-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -716,10 +716,18 @@ buildRequiredPackageLists() {
;;
ddtrace@alpine)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile curl-dev"
if test $DISTRO_MAJMIN_VERSION -ge 317; then
# Alpine 3.17 is the minimum version that comes with cargo 1.64.0+
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cargo"
fi
;;
ddtrace@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent curl"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libcurl4-openssl-dev"
if test $DISTRO_MAJMIN_VERSION -ge 1200; then
# Debian bookworm is the minimum version that comes with cargo 1.64.0+
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cargo"
fi
;;
dba@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent db"
Expand All @@ -732,8 +740,10 @@ buildRequiredPackageLists() {
fi
;;
decimal@debian)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmpdec[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev"
if test $DISTRO_MAJMIN_VERSION -lt 1200; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent ^libmpdec[0-9]*$"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libmpdec-dev"
fi
;;
enchant@alpine)
if test $DISTRO_MAJMIN_VERSION -ge 312; then
Expand Down Expand Up @@ -1960,12 +1970,18 @@ installMicrosoftSqlServerODBC() {
rm -rf /tmp/src/msodbcsql.apk
;;
debian)
if test $DISTRO_VERSION_NUMBER -eq 12; then
DISTRO_VERSION_NUMBER=11
fi

# https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#debian17
printf -- '- installing the Microsoft APT key\n'
if test $DISTRO_VERSION_NUMBER -ge 11; then
# apt-key is deprecated
if test $DISTRO_VERSION_NUMBER -eq 11; then
curl -sSLf -o /etc/apt/trusted.gpg.d/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc
elif test $DISTRO_VERSION_NUMBER -ge 12; then
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor --yes --output /usr/share/keyrings/microsoft-prod.gpg
else
# apt-key is deprecated
curl -sSLf https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
fi
if ! test -f /etc/apt/sources.list.d/mssql-release.list; then
Expand All @@ -1976,12 +1992,16 @@ installMicrosoftSqlServerODBC() {
printf -- '- installing the APT package\n'
if test $PHP_MAJMIN_VERSION -le 703; then
DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17
elif test $DISTRO_VERSION_NUMBER -ge 9 && $DISTRO_VERSION_NUMBER -le 11; then
elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 11; then
# On Debian 9 and 11 we have both msodbcsql17 and msodbcsql18: let's install just one
DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18
else
DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$'
fi

if test $DISTRO_VERSION_NUMBER -eq 11; then
setDistro
fi
;;
esac
}
Expand Down Expand Up @@ -2095,6 +2115,16 @@ installLibavif() {
cd - >/dev/null
}

# Install libmpdec
installLibMPDec() {
installLibMPDec_src="$(getPackageSource https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz)"
cd -- "$installLibMPDec_src"
./configure --disable-cxx
make -j$(getProcessorCount)
make install
cd - >/dev/null
}

# Install Composer
installComposer() {
installComposer_version="$(getWantedPHPModuleVersion @composer)"
Expand Down Expand Up @@ -2618,19 +2648,36 @@ installRemoteModule() {
if test -z "$installRemoteModule_version"; then
if test $PHP_MAJMIN_VERSION -lt 700; then
installRemoteModule_version=0.75.0
else
case "$DISTRO" in
alpine)
if test $DISTRO_MAJMIN_VERSION -lt 317; then
# Alpine 3.17 is the minimum version that comes with cargo 1.64.0+
installRemoteModule_version=0.87.2
fi
;;
debian)
if test $DISTRO_MAJMIN_VERSION -lt 1200; then
# Debian bookworm is the minimum version that comes with cargo 1.64.0+
installRemoteModule_version=0.87.2
fi
;;
esac
fi
fi
;;
decimal)
case "$DISTRO" in
alpine)
if ! test -f /usr/local/lib/libmpdec.so; then
installRemoteModule_src="$(getPackageSource https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz)"
cd -- "$installRemoteModule_src"
./configure --disable-cxx
make -j$(getProcessorCount)
make install
cd - >/dev/null
installLibMPDec
fi
;;
debian)
if test $DISTRO_MAJMIN_VERSION -ge 1200; then
if test -z "$(ldconfig -p | grep -E '\slibmpdec.so\s')"; then
installLibMPDec
fi
fi
;;
esac
Expand Down Expand Up @@ -2778,7 +2825,7 @@ installRemoteModule() {
fi
if test -z "$installRemoteModule_version"; then
# See https://github.com/protocolbuffers/protobuf/issues/10619
installRemoteModule_version=1.55.0
installRemoteModule_version=1.56.0
fi
if test -z "$installRemoteModule_version" || test "$installRemoteModule_version" = 1.35.0; then
case "$DISTRO_VERSION" in
Expand Down

0 comments on commit cbfe759

Please sign in to comment.