diff --git a/Dockerfile b/Dockerfile index c7a5bc7..55a837c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,13 @@ # syntax=docker/dockerfile:1.4 -ARG VERSION=7.3 -ARG BASEOS=bullseye -ARG REDIS_VERSION=6.2 +ARG VERSION +ARG BASEOS +# The redis version is only used in the console image but needs a default value to avoid failing base image +ARG REDIS_VERSION=invalid FROM php:${VERSION}-fpm-${BASEOS} as base # Base Packages # --- -ARG BASEOS=bullseye +ARG BASEOS ENV IMAGE_TYPE=base RUN < + ### Packages -* php-bcmath -* php-gd -* php-intl -* php-mcrypt -* php-opcache -* php-pdo (mysql) -* php-soap -* php-xdebug -* php-xsl -* php-zip + +- php-bcmath +- php-gd +- php-intl +- php-mcrypt +- php-opcache +- php-pdo (mysql) +- php-soap +- php-xdebug +- php-xsl +- php-zip ## Console @@ -19,19 +32,66 @@ Used in development for building and interacting with the application with a fam ### Packages -* build-tools (autoconf, automake, g++, gcc, make, nasm) -* composer (1.10.27 or 2.7.2) -* curl -* gettext-base -* git -* iproute -* mysql (client) -* nano -* nvm -* node (lts/dubnium aka v10, or none for PHP 8.3+) -* npm -* patch -* rsync -* wget -* yarn (if node is installed) -* zip +- build-tools (autoconf, automake, g++, gcc, make, nasm) +- composer (1.10.27 or 2.7.2) +- curl +- gettext-base +- git +- iproute +- mysql (client) +- nano +- nvm +- node (lts/dubnium aka v10, or none for PHP 8.3+) +- npm +- patch +- redis-cli +- rsync +- wget +- yarn (if node is installed) +- zip + +## Supported Versions + +| PHP version | Bookworm | Trixie | +| --- | --- | --- | +| `8.3` | Base + Console | Base + Console | +| `8.4` | Base + Console | Base + Console | + +## Build and Test + +Build and test all Trixie images: + +```bash +BUILD=trixie ./build.sh +BUILD=trixie ./test.sh +docker image rm \ + my127/php:8.3-fpm-trixie \ + my127/php:8.3-fpm-trixie-console \ + my127/php:8.4-fpm-trixie \ + my127/php:8.4-fpm-trixie-console +``` + +Build and test all PHP 8.4 images: + +```bash +BUILD=php84 ./build.sh +BUILD=php84 ./test.sh +docker image rm \ + my127/php:8.4-fpm-bookworm \ + my127/php:8.4-fpm-bookworm-console \ + my127/php:8.4-fpm-trixie \ + my127/php:8.4-fpm-trixie-console +``` + +Build and test a single image: + +```bash +BUILD=php84-fpm-trixie-console ./build.sh +BUILD=php84-fpm-trixie-console ./test.sh +``` + +Remove locally built images when finished: + +```bash +docker image rm my127/php:8.4-fpm-trixie-console +``` diff --git a/docker-compose.yml b/docker-compose.yml index 3bdd206..b3a4867 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,50 +1,22 @@ services: # Base Images - php81-fpm-bullseye-base: - image: my127/php:8.1-fpm-bullseye${TAG_SUFFIX:-} - build: - context: ./ - target: base - args: - VERSION: "8.1" - BASEOS: bullseye - - php81-fpm-bookworm-base: - image: my127/php:8.1-fpm-bookworm${TAG_SUFFIX:-} - build: - context: ./ - target: base - args: - VERSION: "8.1" - BASEOS: bookworm - - php82-fpm-bullseye-base: - image: my127/php:8.2-fpm-bullseye${TAG_SUFFIX:-} - build: - context: ./ - target: base - args: - VERSION: "8.2" - BASEOS: bullseye - - php82-fpm-bookworm-base: - image: my127/php:8.2-fpm-bookworm${TAG_SUFFIX:-} + php83-fpm-bookworm-base: + image: my127/php:8.3-fpm-bookworm${TAG_SUFFIX:-} build: context: ./ target: base args: - VERSION: "8.2" + VERSION: "8.3" BASEOS: bookworm - php83-fpm-bookworm-base: - image: my127/php:8.3-fpm-bookworm${TAG_SUFFIX:-} + php83-fpm-trixie-base: + image: my127/php:8.3-fpm-trixie${TAG_SUFFIX:-} build: context: ./ target: base args: VERSION: "8.3" - REDIS_VERSION: "7.2" - BASEOS: bookworm + BASEOS: trixie php84-fpm-bookworm-base: image: my127/php:8.4-fpm-bookworm${TAG_SUFFIX:-} @@ -53,72 +25,58 @@ services: target: base args: VERSION: "8.4" - REDIS_VERSION: "7.4" BASEOS: bookworm - # Console Images - php81-fpm-bullseye-console: - image: my127/php:8.1-fpm-bullseye-console${TAG_SUFFIX:-} + php84-fpm-trixie-base: + image: my127/php:8.4-fpm-trixie${TAG_SUFFIX:-} build: context: ./ - target: console + target: base args: - VERSION: "8.1" - COMPOSER_VERSION: "2.8.12" - NODE_VERSION: "10" - BASEOS: bullseye + VERSION: "8.4" + BASEOS: trixie - php81-fpm-bookworm-console: - image: my127/php:8.1-fpm-bookworm-console${TAG_SUFFIX:-} + # Console Images + php83-fpm-bookworm-console: + image: my127/php:8.3-fpm-bookworm-console${TAG_SUFFIX:-} build: context: ./ target: console args: - VERSION: "8.1" - COMPOSER_VERSION: "2.8.12" - NODE_VERSION: "10" + VERSION: "8.3" + COMPOSER_VERSION: "2.10.1" + REDIS_VERSION: "7.2" BASEOS: bookworm - php82-fpm-bullseye-console: - image: my127/php:8.2-fpm-bullseye-console${TAG_SUFFIX:-} + php83-fpm-trixie-console: + image: my127/php:8.3-fpm-trixie-console${TAG_SUFFIX:-} build: context: ./ target: console args: - VERSION: "8.2" - COMPOSER_VERSION: "2.8.12" - NODE_VERSION: "10" - BASEOS: bullseye - - php82-fpm-bookworm-console: - image: my127/php:8.2-fpm-bookworm-console${TAG_SUFFIX:-} - build: - context: ./ - target: console - args: - VERSION: "8.2" - COMPOSER_VERSION: "2.8.12" - NODE_VERSION: "10" - BASEOS: bookworm + VERSION: "8.3" + COMPOSER_VERSION: "2.10.1" + REDIS_VERSION: "8.8" + BASEOS: trixie - php83-fpm-bookworm-console: - image: my127/php:8.3-fpm-bookworm-console${TAG_SUFFIX:-} + php84-fpm-bookworm-console: + image: my127/php:8.4-fpm-bookworm-console${TAG_SUFFIX:-} build: context: ./ target: console args: - VERSION: "8.3" - COMPOSER_VERSION: "2.8.12" - REDIS_VERSION: "7.2" + VERSION: "8.4" + COMPOSER_VERSION: "2.10.1" + REDIS_VERSION: "7.4" BASEOS: bookworm - php84-fpm-bookworm-console: - image: my127/php:8.4-fpm-bookworm-console${TAG_SUFFIX:-} + php84-fpm-trixie-console: + image: my127/php:8.4-fpm-trixie-console${TAG_SUFFIX:-} build: context: ./ target: console args: VERSION: "8.4" - COMPOSER_VERSION: "2.8.12" - REDIS_VERSION: "7.4" - BASEOS: bookworm + COMPOSER_VERSION: "2.10.1" + REDIS_VERSION: "8.8" + BASEOS: trixie diff --git a/installer/base/extensions/gd.sh b/installer/base/extensions/gd.sh index 2904702..32604ba 100644 --- a/installer/base/extensions/gd.sh +++ b/installer/base/extensions/gd.sh @@ -13,24 +13,12 @@ function compile_gd() { _gd_deps_build - case "$VERSION" in - "7.3") - docker-php-ext-configure gd \ - --with-gd \ - --with-freetype-dir=/usr/include/ \ - --with-png-dir=/usr/include/ \ - --with-jpeg-dir=/usr/include/ \ - --with-webp-dir=/usr/include/ \ - --with-xpm-dir=/usr/include/ - ;; - *) - docker-php-ext-configure gd \ - --enable-gd \ - --with-freetype \ - --with-jpeg \ - --with-webp \ - --with-xpm - esac + docker-php-ext-configure gd \ + --enable-gd \ + --with-freetype \ + --with-jpeg \ + --with-webp \ + --with-xpm docker-php-ext-install gd diff --git a/installer/base/extensions/protobuf.sh b/installer/base/extensions/protobuf.sh index 85527d3..50a5c84 100644 --- a/installer/base/extensions/protobuf.sh +++ b/installer/base/extensions/protobuf.sh @@ -11,14 +11,5 @@ function install_protobuf() function compile_protobuf() { - case "$VERSION" in - 7.*) - printf "\n" | pecl install protobuf-3.20.3 - ;; - 8.0) - printf "\n" | pecl install protobuf-3.25.3 - ;; - *) - printf "\n" | pecl install protobuf - esac + printf "\n" | pecl install protobuf } diff --git a/installer/base/extensions/tideways.sh b/installer/base/extensions/tideways.sh index 0dbb02e..a3a0c53 100644 --- a/installer/base/extensions/tideways.sh +++ b/installer/base/extensions/tideways.sh @@ -27,11 +27,7 @@ function _tideways_deps_runtime() function _tideways_deps_build() { - install \ - apt-transport-https \ - gnupg2 - - echo 'deb https://packages.tideways.com/apt-packages-main any-version main' > /etc/apt/sources.list.d/tideways.list - curl --fail --silent --show-error --location 'https://packages.tideways.com/key.gpg' | apt-key add - + curl --fail --silent --show-error --location --output /usr/share/keyrings/tideways.asc 'https://packages.tideways.com/key.gpg' + echo 'deb [signed-by=/usr/share/keyrings/tideways.asc] https://packages.tideways.com/apt-packages-main any-version main' > /etc/apt/sources.list.d/tideways.list apt-get update -qq } diff --git a/installer/base/extensions/xdebug.sh b/installer/base/extensions/xdebug.sh index 97727e8..b4efd78 100755 --- a/installer/base/extensions/xdebug.sh +++ b/installer/base/extensions/xdebug.sh @@ -13,13 +13,5 @@ function compile_xdebug() ( set -o errexit -o pipefail - case "$VERSION" in - 7.*) - XDEBUG_PACKAGE="xdebug-2.9.8" - printf "\n" | pecl install "$XDEBUG_PACKAGE" - ;; - *) - XDEBUG_PACKAGE="xdebug" - printf "\n" | pecl install "$XDEBUG_PACKAGE" - esac + printf "\n" | pecl install xdebug ) diff --git a/installer/base/extensions/zip.sh b/installer/base/extensions/zip.sh index 626a463..05a0928 100755 --- a/installer/base/extensions/zip.sh +++ b/installer/base/extensions/zip.sh @@ -22,6 +22,10 @@ function compile_zip() function _zip_deps_runtime() { + if [ "${BASEOS}" = "trixie" ]; then + install libzip5 + return + fi install libzip4 } diff --git a/installer/bookworm/extensions/event.sh b/installer/bookworm/extensions/event.sh index 41f8bbe..e902407 100644 --- a/installer/bookworm/extensions/event.sh +++ b/installer/bookworm/extensions/event.sh @@ -15,14 +15,7 @@ function compile_event() { _event_deps_build - local PACKAGE_NAME="event" - case "$VERSION" in - "8.0") - PACKAGE_NAME="event-3.0.2" - ;; - esac - - if ! printf "\n" | pecl install "$PACKAGE_NAME"; then + if ! printf "\n" | pecl install event; then return 1 fi diff --git a/installer/bullseye/extensions/event.sh b/installer/bullseye/extensions/event.sh index 41f8bbe..e902407 100644 --- a/installer/bullseye/extensions/event.sh +++ b/installer/bullseye/extensions/event.sh @@ -15,14 +15,7 @@ function compile_event() { _event_deps_build - local PACKAGE_NAME="event" - case "$VERSION" in - "8.0") - PACKAGE_NAME="event-3.0.2" - ;; - esac - - if ! printf "\n" | pecl install "$PACKAGE_NAME"; then + if ! printf "\n" | pecl install event; then return 1 fi diff --git a/installer/buster/extensions/event.sh b/installer/trixie/extensions/event.sh similarity index 72% rename from installer/buster/extensions/event.sh rename to installer/trixie/extensions/event.sh index 460b74c..0c73e5f 100644 --- a/installer/buster/extensions/event.sh +++ b/installer/trixie/extensions/event.sh @@ -15,14 +15,7 @@ function compile_event() { _event_deps_build - local PACKAGE_NAME="event" - case "$VERSION" in - "8.0") - PACKAGE_NAME="event-3.0.2" - ;; - esac - - if ! printf "\n" | pecl install "$PACKAGE_NAME"; then + if ! printf "\n" | pecl install event; then return 1 fi @@ -35,9 +28,9 @@ function _event_deps_runtime() sockets install \ - libevent-2.1-6 \ - libevent-extra-2.1-6 \ - libevent-openssl-2.1-6 + libevent-2.1-7t64 \ + libevent-extra-2.1-7t64 \ + libevent-openssl-2.1-7t64 } function _event_deps_build() diff --git a/installer/buster/extensions/intl.sh b/installer/trixie/extensions/intl.sh similarity index 95% rename from installer/buster/extensions/intl.sh rename to installer/trixie/extensions/intl.sh index 5e686a1..3523d37 100644 --- a/installer/buster/extensions/intl.sh +++ b/installer/trixie/extensions/intl.sh @@ -20,7 +20,7 @@ function compile_intl() function _intl_deps_runtime() { - install libicu63 + install libicu76 } function _intl_deps_build() diff --git a/installer/trixie/extensions/memcached.sh b/installer/trixie/extensions/memcached.sh new file mode 100755 index 0000000..e73b41a --- /dev/null +++ b/installer/trixie/extensions/memcached.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +function install_memcached() +{ + _memcached_deps_runtime + + if ! has_extension memcached; then + compile_memcached + fi + + docker-php-ext-enable memcached +} + +function compile_memcached() +{ + _memcached_deps_build + + printf "\n" | pecl install memcached + + _memcached_clean +} + +function _memcached_deps_runtime() +{ + install libmemcached11t64 libmemcachedutil2t64 +} + +function _memcached_deps_build() +{ + install libmemcached-dev libssl-dev zlib1g-dev +} + +function _memcached_clean() +{ + remove libmemcached-dev libssl-dev zlib1g-dev +}