From a28e506abe18f4db58086613079fb37cabaf26c9 Mon Sep 17 00:00:00 2001 From: Chingis Sandanov Date: Thu, 7 Dec 2023 14:33:44 +0300 Subject: [PATCH] Add PHP 8.3, drop 8.0, update extensions Extensions updates xdebug 3.3.0 apcu 1.5.23 mongodb 1.17.1 brotli 0.14.2 amqp 2.1.1 (from 1.x) ast 1.1.1 igbinary 3.2.15 smbclient 1.1.1 PHP 8.3 comes without newrelic, ds and imagick #187 closes #185 closes #186 --- .github/workflows/workflow.yml | 56 +++++++++---------- .php | 4 +- 8/Dockerfile | 54 +++++++++--------- 8/Makefile | 3 +- 8/docker-entrypoint.sh | 4 +- ...p-8.0.ini.tmpl => docker-php-8.3.ini.tmpl} | 1 + 8/tests/php_modules/{8.0 => 8.3} | 5 +- README.md | 52 +++++++++-------- 8 files changed, 88 insertions(+), 91 deletions(-) rename 8/templates/{docker-php-8.0.ini.tmpl => docker-php-8.3.ini.tmpl} (98%) rename 8/tests/php_modules/{8.0 => 8.3} (95%) diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index c754e8b5..4be243d1 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -11,14 +11,14 @@ on: pull_request: env: + PHP83: '8.3.0' PHP82: '8.2.13' PHP81: '8.1.26' - PHP80: '8.0.30' DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} jobs: - php82: + php83: runs-on: ubuntu-latest defaults: run: @@ -31,11 +31,11 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP82 }} - tags: 8.2,8,latest + version: ${{ env.PHP83 }} + tags: 8.3,8,latest workdir: 8 platform: linux/amd64,linux/arm64 - php81: + php82: runs-on: ubuntu-latest defaults: run: @@ -48,11 +48,11 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP81 }} - tags: 8.1 + version: ${{ env.PHP82 }} + tags: 8.2 workdir: 8 platform: linux/amd64,linux/arm64 - php80: + php81: runs-on: ubuntu-latest defaults: run: @@ -65,12 +65,12 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP80 }} - tags: '8.0' + version: ${{ env.PHP81 }} + tags: 8.1 workdir: 8 platform: linux/amd64,linux/arm64 ### dev - php82-dev: + php83-dev: runs-on: ubuntu-latest defaults: run: @@ -83,12 +83,12 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP82 }} + version: ${{ env.PHP83 }} dev: 1 - tags: 8.2-dev,8-dev,dev + tags: 8.3-dev,8-dev,dev workdir: 8 platform: linux/amd64,linux/arm64 - php81-dev: + php82-dev: runs-on: ubuntu-latest defaults: run: @@ -101,12 +101,12 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP81 }} + version: ${{ env.PHP82 }} dev: 1 - tags: 8.1-dev + tags: 8.2-dev workdir: 8 platform: linux/amd64,linux/arm64 - php80-dev: + php81-dev: runs-on: ubuntu-latest defaults: run: @@ -119,13 +119,13 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP80 }} + version: ${{ env.PHP81 }} dev: 1 - tags: 8.0-dev + tags: 8.1-dev workdir: 8 platform: linux/amd64,linux/arm64 ### dev-macos - php82-dev-macos: + php83-dev-macos: runs-on: ubuntu-latest defaults: run: @@ -138,14 +138,14 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP82 }} + version: ${{ env.PHP83 }} dev: 1 user_id: 501 group_id: 20 - tags: 8.2-dev-macos,8-dev-macos,dev-macos + tags: 8.3-dev-macos,8-dev-macos,dev-macos workdir: 8 platform: linux/amd64,linux/arm64 - php81-dev-macos: + php82-dev-macos: runs-on: ubuntu-latest defaults: run: @@ -158,14 +158,14 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP81 }} + version: ${{ env.PHP82 }} dev: 1 user_id: 501 group_id: 20 - tags: 8.1-dev-macos + tags: 8.2-dev-macos workdir: 8 platform: linux/amd64,linux/arm64 - php80-dev-macos: + php81-dev-macos: runs-on: ubuntu-latest defaults: run: @@ -178,10 +178,10 @@ jobs: - uses: docker/setup-buildx-action@v1 - uses: ./.github/actions with: - version: ${{ env.PHP80 }} + version: ${{ env.PHP81 }} dev: 1 user_id: 501 group_id: 20 - tags: 8.0-dev-macos + tags: 8.1-dev-macos workdir: 8 platform: linux/amd64,linux/arm64 diff --git a/.php b/.php index e876120c..1e3a8244 100644 --- a/.php +++ b/.php @@ -1,3 +1,3 @@ +8.3.0#2023-11-28T03:57:17.87134Z 8.2.13#2023-11-28T03:57:17.87134Z -8.1.26#2023-11-28T03:52:05.959942Z -8.0.30#2023-11-22T06:12:09.806534Z \ No newline at end of file +8.1.26#2023-11-28T03:52:05.959942Z \ No newline at end of file diff --git a/8/Dockerfile b/8/Dockerfile index 9283f20f..134971d9 100644 --- a/8/Dockerfile +++ b/8/Dockerfile @@ -185,7 +185,7 @@ RUN set -xe; \ docker-php-ext-configure gd \ --with-webp \ --with-freetype \ - $(test "${PHP_VERSION:0:3}" != "8.0" && echo '--with-avif') \ + --with-avif \ --with-jpeg; \ NPROC=$(getconf _NPROCESSORS_ONLN); \ docker-php-ext-install "-j${NPROC}" gd; \ @@ -213,26 +213,26 @@ RUN set -xe; \ rm ./*.apk; \ \ pecl install \ - apcu-5.1.22 \ - amqp-1.11.0 \ - ast-1.1.0 \ - ds-1.4.0 \ + apcu-5.1.23 \ + amqp-2.1.1 \ + ast-1.1.1 \ + $(test "${PHP_VERSION:0:3}" != "8.3" && echo 'ds 1.4.0') \ event-3.0.8 \ # grpc-1.34.0 \ - igbinary-3.2.14 \ - imagick-3.7.0 \ + igbinary-3.2.15 \ + $(test "${PHP_VERSION:0:3}" != "8.3" && echo 'imagick-3.7.0') \ memcached-3.2.0 \ - mongodb-1.15.1 \ + mongodb-1.17.1 \ oauth-2.0.7 \ pdo_sqlsrv-5.11.1 \ pcov \ rdkafka-6.0.3 \ redis-5.3.7 \ sqlsrv-5.11.1 \ - smbclient-1.0.6 \ + smbclient-1.1.1 \ uploadprogress-2.0.2 \ uuid-1.2.0 \ - xdebug-3.2.2 \ + xdebug-3.3.0 \ xhprof-2.3.9 \ yaml-2.2.3; \ \ @@ -240,10 +240,10 @@ RUN set -xe; \ apcu \ amqp \ ast \ - ds \ + $(test "${PHP_VERSION:0:3}" != "8.3" && echo 'ds') \ event \ igbinary \ - imagick \ + $(test "${PHP_VERSION:0:3}" != "8.3" && echo 'imagick') \ # grpc \ memcached \ mongodb \ @@ -260,28 +260,26 @@ RUN set -xe; \ xhprof \ yaml; \ \ - if [[ "${PHP_VERSION:0:3}" == "8.0" ]]; then \ - pecl install mcrypt-1.0.4; \ - docker-php-ext-enable mcrypt; \ - fi; \ # Event extension should be loaded after sockets. # http://osmanov-dev-notes.blogspot.com/2013/07/fixing-php-start-up-error-unable-to.html mv /usr/local/etc/php/conf.d/docker-php-ext-event.ini /usr/local/etc/php/conf.d/z-docker-php-ext-event.ini; \ \ - # NewRelic extension and agent. \ - newrelic_url="http://download.newrelic.com/php_agent/release/"; \ - wget -r -nd --no-parent -P /tmp/newrelic -Alinux-musl.tar.gz "${newrelic_url}" >/dev/null 2>&1; \ - tar -xzf /tmp/newrelic/newrelic-php*.tar.gz --strip=1 -C /tmp/newrelic; \ - export NR_INSTALL_SILENT=true; \ - export NR_INSTALL_USE_CP_NOT_LN=true; \ - bash /tmp/newrelic/newrelic-install install; \ - rm -f /usr/local/etc/php/conf.d/newrelic.ini; \ - mkdir -p /var/log/newrelic/; \ - chown -R www-data:www-data /var/log/newrelic/; \ - chmod -R 775 /var/log/newrelic/; \ + if [[ "${PHP_VERSION:0:3}" != "8.3" ]]; then \ + # NewRelic extension and agent. \ + newrelic_url="http://download.newrelic.com/php_agent/release/"; \ + wget -r -nd --no-parent -P /tmp/newrelic -Alinux-musl.tar.gz "${newrelic_url}" >/dev/null 2>&1; \ + tar -xzf /tmp/newrelic/newrelic-php*.tar.gz --strip=1 -C /tmp/newrelic; \ + export NR_INSTALL_SILENT=true; \ + export NR_INSTALL_USE_CP_NOT_LN=true; \ + bash /tmp/newrelic/newrelic-install install; \ + rm -f /usr/local/etc/php/conf.d/newrelic.ini; \ + mkdir -p /var/log/newrelic/; \ + chown -R www-data:www-data /var/log/newrelic/; \ + chmod -R 775 /var/log/newrelic/; \ + fi; \ \ # Brotli extension. - brotli_ext_ver="0.13.1"; \ + brotli_ext_ver="0.14.2"; \ mkdir -p /usr/src/php/ext/brotli; \ brotli_url="https://github.com/kjdev/php-ext-brotli/archive/refs/tags/${brotli_ext_ver}.tar.gz"; \ wget -qO- "${brotli_url}" | tar xz --strip-components=1 -C /usr/src/php/ext/brotli; \ diff --git a/8/Makefile b/8/Makefile index 9e5f25b3..dae85d48 100644 --- a/8/Makefile +++ b/8/Makefile @@ -1,6 +1,6 @@ -include env_make -PHP_VER ?= 8.2.13 +PHP_VER ?= 8.3.0 PHP_VER_MINOR ?= $(shell echo "${PHP_VER}" | grep -oE '^[0-9]+\.[0-9]+') REPO = wodby/php @@ -102,6 +102,7 @@ logs: clean: -docker rm -f $(NAME) + -IMAGE=$(REPO):$(TAG) docker-compose -f tests/docker-compose.yml down check-configs: ./check-configs.sh $(PHP_VER) $(PHP_VER_MINOR) diff --git a/8/docker-entrypoint.sh b/8/docker-entrypoint.sh index 1810b0c7..b5d12643 100755 --- a/8/docker-entrypoint.sh +++ b/8/docker-entrypoint.sh @@ -61,7 +61,9 @@ process_templates() { fi # Extensions that don't work with --enabled-debug - _gotpl "docker-php-ext-newrelic.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-newrelic.ini" + if [[ "${php_ver_minor}" != "8.3" ]]; then + _gotpl "docker-php-ext-newrelic.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-newrelic.ini" + fi; _gotpl "docker-php-${php_ver_minor}.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php.ini" _gotpl "docker-php-ext-apcu.ini.tmpl" "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini" diff --git a/8/templates/docker-php-8.0.ini.tmpl b/8/templates/docker-php-8.3.ini.tmpl similarity index 98% rename from 8/templates/docker-php-8.0.ini.tmpl rename to 8/templates/docker-php-8.3.ini.tmpl index 38123a5f..e22af6b4 100644 --- a/8/templates/docker-php-8.0.ini.tmpl +++ b/8/templates/docker-php-8.3.ini.tmpl @@ -37,6 +37,7 @@ phar.cache_list = {{ getenv "PHP_PHAR_CACHE_LIST" "" }} [mail function] sendmail_path = {{ getenv "PHP_SENDMAIL_PATH" "/bin/true" }} +mail.mixed_lf_and_crlf = {{ getenv "PHP_MAIL_MIXED_LF_AND_CRLF" "Off" }} [MySQLi] mysqli.cache_size = {{ getenv "PHP_MYSQLI_CACHE_SIZE" "2000" }} diff --git a/8/tests/php_modules/8.0 b/8/tests/php_modules/8.3 similarity index 95% rename from 8/tests/php_modules/8.0 rename to 8/tests/php_modules/8.3 index a85a0fb8..ba990f1a 100644 --- a/8/tests/php_modules/8.0 +++ b/8/tests/php_modules/8.3 @@ -11,7 +11,6 @@ ctype curl date dom -ds event exif fileinfo @@ -22,7 +21,6 @@ gmp hash iconv igbinary -imagick imap intl json @@ -30,12 +28,10 @@ ldap libsmbclient libxml mbstring -mcrypt memcached mongodb mysqli mysqlnd -newrelic OAuth openssl pcntl @@ -49,6 +45,7 @@ pdo_sqlsrv pgsql Phar posix +random rdkafka readline redis diff --git a/README.md b/README.md index b2d44621..f2644f0a 100644 --- a/README.md +++ b/README.md @@ -40,15 +40,15 @@ About images: Supported tags and respective `Dockerfile` links: -- `8.2`, `8`, `latest` [_(8/Dockerfile)_] +- `8.3`, `8`, `latest` [_(8/Dockerfile)_] +- `8.2` [_(8/Dockerfile)_] - `8.1` [_(8/Dockerfile)_] -- `8.0` [_(8/Dockerfile)_] -- `8.2-dev`, `8-dev`, `dev` [_(8/Dockerfile)_] +- `8.3-dev`, `8-dev`, `dev` [_(8/Dockerfile)_] +- `8.2-dev` [_(8/Dockerfile)_] - `8.1-dev` [_(8/Dockerfile)_] -- `8.0-dev` [_(8/Dockerfile)_] -- `8.2-dev-macos`, `8-dev-macos`, `dev-macos` [_(8/Dockerfile)_] +- `8.3-dev-macos`, `8-dev-macos`, `dev-macos` [_(8/Dockerfile)_] +- `8.2-dev-macos` [_(8/Dockerfile)_] - `8.1-dev-macos` [_(8/Dockerfile)_] -- `8.0-dev-macos` [_(8/Dockerfile)_] ### `-dev` @@ -73,7 +73,7 @@ All images built for `linux/amd64` and `linux/arm64` The default configuration not recommended for use for production environment: -| Variable | 8.2 | 8.1 | 8.0 | +| Variable | 8.3 | 8.2 | 8.1 | |-----------------------------------------|----------------|----------------|----------------| | [`PHP_ALLOW_URL_FOPEN`] | `On` | `On` | `On` | | [`PHP_APCU_ENABLE_CLI`] | `0` | `0` | `0` | @@ -150,11 +150,11 @@ The default configuration not recommended for use for production environment: | [`PHP_REALPATH_CACHE_SIZE`] | `4096k` | `4096k` | `4096k` | | [`PHP_REALPATH_CACHE_TTL`] | `120` | `120` | `120` | | [`PHP_SENDMAIL_PATH`] | `/bin/true` | `/bin/true` | `/bin/true` | -| `PHP_MAIL_MIXED_LF_AND_CRLF` | `Off` | - | | +| `PHP_MAIL_MIXED_LF_AND_CRLF` | `Off` | `Off` | - | | [`PHP_SESSION_SAVE_HANDLER`] | `files` | `files` | `files` | | [`PHP_SHORT_OPEN_TAG`] | `1` | `1` | `1` | | _see all sqlsrv ext options_ | - | - | - | -| _see all session options_ | [8.2 session] | [8.1 session] | [8.0 session] | +| _see all session options_ | [8.3 session] | [8.2 session] | [8.1 session] | | `PHP_XHPROF` | | | | | _see all xhprof options_ | [8.x xhprof] | [8.x xhprof] | [8.x xhprof] | | [`PHP_UPLOAD_MAX_FILESIZE`] | `32M` | `32M` | `32M` | @@ -201,13 +201,13 @@ user/group ids the latter will be deleted. You can disable extension by listing them in `$PHP_EXTENSIONS_DISABLE` separated by `,`, e.g. `$PHP_EXTENSIONS_DISABLE=event,ds` -| Extension | 8.2 | 8.1 | 8.0 | +| Extension | 8.3 | 8.2 | 8.1 | |------------------|--------|--------|--------| -| [amqp] | 1.11.0 | 1.11.0 | 1.11.0 | -| [apcu] | 5.1.22 | 5.1.22 | 5.1.22 | -| [ast] | 1.1.0 | 1.1.0 | 1.1.0 | +| [amqp] | 2.1.1 | 2.1.1 | 2.1.1 | +| [apcu] | 5.1.23 | 5.1.23 | 5.1.23 | +| [ast] | 1.1.1 | 1.1.1 | 1.1.1 | | bcmath | | | | -| brotli | 0.13.1 | 0.13.1 | 0.13.1 | +| brotli | 0.14.2 | 0.14.2 | 0.14.2 | | bz2 | | | | | calendar | | | | | Core | | | | @@ -215,7 +215,7 @@ e.g. `$PHP_EXTENSIONS_DISABLE=event,ds` | curl | | | | | date | | | | | dom | | | | -| [ds] | 1.4.0 | 1.4.0 | 1.4.0 | +| [ds] | - | 1.4.0 | 1.4.0 | | exif | | | | | [event] | 3.0.8 | 3.0.8 | 3.0.8 | | fileinfo | | | | @@ -224,20 +224,19 @@ e.g. `$PHP_EXTENSIONS_DISABLE=event,ds` | gd | | | | | hash | | | | | iconv | | | | -| [igbinary] | 3.2.14 | 3.2.14 | 3.2.14 | -| [imagick] | 3.7.0 | 3.7.0 | 3.7.0 | +| [igbinary] | 3.2.15 | 3.2.15 | 3.2.15 | +| [imagick] | - | 3.7.0 | 3.7.0 | | imap | | | | | intl | | | | | json | | | | | ldap | | | | | libxml | | | | | mbstring | | | | -| [mcrypt] | - | - | 1.0.4 | | [memcached] | 3.2.0 | 3.2.0 | 3.2.0 | -| [mongodb] | 1.15.1 | 1.15.1 | 1.13.1 | +| [mongodb] | 1.17.1 | 1.17.1 | 1.17.1 | | mysqli | | | | | mysqlnd | | | | -| [newrelic] | latest | latest | latest | +| [newrelic] | - | latest | latest | | [OAuth] | 2.0.7 | 2.0.7 | 2.0.7 | | openssl | | | | | [pcov] | latest | latest | latest | @@ -251,13 +250,13 @@ e.g. `$PHP_EXTENSIONS_DISABLE=event,ds` | pgsql | | | | | Phar | | | | | posix | | | | -| [rdkafka] | 6.0.3 | 6.0.3 | 6.0.1 | +| [rdkafka] | 6.0.3 | 6.0.3 | 6.0.3 | | readline | | | | | [redis] | 5.3.7 | 5.3.7 | 5.3.7 | | Reflection | | | | | session | | | | | SimpleXML | | | | -| [smbclient] | 1.0.6 | 1.0.6 | 1.0.6 | +| [smbclient] | 1.1.1 | 1.1.1 | 1.1.1 | | soap | | | | | sockets | | | | | sodium | | | | @@ -269,7 +268,7 @@ e.g. `$PHP_EXTENSIONS_DISABLE=event,ds` | tokenizer | | | | | [uploadprogress] | 2.0.2 | 2.0.2 | 2.0.2 | | [uuid] | 1.2.0 | 1.2.0 | 1.2.0 | -| [xdebug] | 3.2.2 | 3.2.2 | 3.2.2 | +| [xdebug] | 3.3.0 | 3.3.0 | 3.3.0 | | [xhprof] | 2.3.9 | 2.3.9 | 2.3.9 | | xml | | | | | xmlreader | | | | @@ -292,7 +291,7 @@ Extensions xdebug and xhprof disabled by default. ## Tools -| Tool | 8.2 | 8.1 | 8.0 | +| Tool | 8.3 | 8.2 | 8.1 | |-------------------------------------|--------|--------|--------| | [Composer](https://getcomposer.org) | latest | latest | latest | @@ -347,6 +346,7 @@ See https://github.com/wodby/php/issues/22 for more details. ## Complete PHP-based stacks - [wodby/docker4php](https://github.com/wodby/docker4php) +- [wodby/docker4laravel](https://github.com/wodby/docker4laravel) - [wodby/docker4drupal](https://github.com/wodby/docker4drupal) - [wodby/docker4wordpress](https://github.com/wodby/docker4wordpress) @@ -384,10 +384,8 @@ default params values: [_(8/Dockerfile)_]: https://github.com/wodby/php/tree/master/8/Dockerfile - [8.x xdebug]: https://github.com/wodby/php/tree/master/8/templates/docker-php-ext-xdebug.ini.tmpl - [8.x pcov]: https://github.com/wodby/php/tree/master/8/templates/docker-php-ext-pcov.ini.tmpl [8.x newrelic]: https://github.com/wodby/php/tree/master/8/templates/docker-php-ext-newrelic.ini.tmpl @@ -398,7 +396,7 @@ default params values: [8.2 session]: https://github.com/wodby/php/tree/master/8/templates/docker-php-8.2.ini.tmpl -[8.0 session]: https://github.com/wodby/php/tree/master/8/templates/docker-php-8.0.ini.tmpl +[8.3 session]: https://github.com/wodby/php/tree/master/8/templates/docker-php-8.3.ini.tmpl [`PHP_ALLOW_URL_FOPEN`]: http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen