From eb5fe79869112f63adc78b27dabd5187ad3c9b45 Mon Sep 17 00:00:00 2001 From: Mathias Buresch Date: Tue, 30 Apr 2024 17:08:17 +0200 Subject: [PATCH] adjust for php 8.2 and 8.3 (#79) * adjust for php 8.2 and 8.3 * only 8.2 * increase matomo to recent version * remove temporary variable setting --------- Co-authored-by: Mathias Buresch --- Dockerfile | 6 ++++-- bin/ci.sh | 6 ++++-- bin/image.sh | 5 +++-- docker/common.inc.sh | 18 ++++++++++++++++++ example/matomo/Dockerfile | 2 +- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 792d858..56b924c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,9 +31,11 @@ ENV ENABLE_GCP="${ENABLE_GCP:-0}" \ # ssmtp: synchronouse mailer, very handy in CLI scripts on docker ENV PATH="${PATH}:${WORKDIR}/docker/bin" \ BUILD_PACKAGES="ccache build-essential unzip zip" \ - SYSTEM_PACKAGES="ssmtp busybox-static netcat vim less tree libtcmalloc-minimal4 git postgresql-client gettext nginx apt-transport-https" \ + SYSTEM_PACKAGES="ssmtp busybox-static netcat-traditional vim less tree libtcmalloc-minimal4 git postgresql-client gettext nginx apt-transport-https" \ JESSIE_PACKAGE_MAP="libpng16-16:libpng12-0 libicu57:libicu52 libmagickwand-6.q16-3:libmagickwand-6.q16-2 libmagickcore-6.q16-3:libmagickcore-6.q16-2 npm:" \ BUSTER_PACKAGE_MAP="libicu57:libicu63 libmagickwand-6.q16-3:libmagickwand-6.q16-6 libmagickcore-6.q16-3:libmagickcore-6.q16-6 ssmtp:msmtp" \ + BULLSEYE_PACKAGE_MAP="libicu57:libicu67 libmagickwand-6.q16-3:libmagickwand-6.q16-6 libmagickcore-6.q16-3:libmagickcore-6.q16-6 ssmtp:msmtp" \ + BOOKWORM_PACKAGE_MAP="libicu57:libicu72 libmagickwand-6.q16-3:libmagickwand-6.q16-6 libmagickcore-6.q16-3:libmagickcore-6.q16-6 ssmtp:msmtp libldap-2.4-2:libldap-2.5-0" \ ENABLE_NEWRELIC="false" # NGINX @@ -60,7 +62,7 @@ ENV PHP="php" \ NEWRELIC_PHP_VERSION="php5-8.0.0.204" \ PHP_EXTENSIONS_STARTUP_ONLY="xdebug APCu imagick redis" \ PHP_EXTENSIONS_STARTUP_ENABLE="" \ - PHP_EXTENSIONS="bcmath bz2 gd gmp intl json mbstring opcache dom curl pgsql pdo_pgsql pdo_mysql ldap soap zip xdebug-3.1.5 imagick-3.7.0 redis-5.3.7 APCu" \ + PHP_EXTENSIONS="bcmath bz2 gd gmp intl json mbstring opcache dom curl pgsql pdo_pgsql pdo_mysql ldap soap zip xdebug imagick-3.7.0 redis-5.3.7 APCu" \ PHP_BUILD_PACKAGES="re2c libmagickwand-6.q16-dev libbz2-dev libldap2-dev libgmp-dev libicu-dev libpq-dev libpq-dev libreadline6-dev libedit-dev libxml2-dev libcurl4-openssl-dev zlib1g-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev libzip-dev" \ SYSTEM_PACKAGES="${SYSTEM_PACKAGES} libldap-2.4-2 libpng16-16 libicu57 libjpeg62-turbo libfreetype6 libmagickwand-6.q16-3 libmagickcore-6.q16-3 libzip4" \ PHP_INI_DIR="/usr/local/etc/php" \ diff --git a/bin/ci.sh b/bin/ci.sh index a1f6786..c1bed4f 100755 --- a/bin/ci.sh +++ b/bin/ci.sh @@ -5,8 +5,10 @@ WORKDIR=$(realpath $0 | xargs dirname | xargs dirname) export VERSION=$(cat $WORKDIR/VERSION) export IMAGE_NAME="claranet/php" -FROM_IMAGE_TAGS="7.1.33-fpm-stretch 7.2.34-fpm-stretch 7.3.28-fpm-stretch" -LATEST_IMAGE="7.3.28-fpm-stretch" +#FROM_IMAGE_TAGS="8.2.18-fpm-bookworm 8.3.6-fpm-bookworm" +FROM_IMAGE_TAGS="8.2.18-fpm-bookworm" +LATEST_IMAGE="8.2.18-fpm-bookworm" +#LATEST_IMAGE="8.3.6-fpm-bookworm" # Based on $GITHUB_HEAD_REF which is set fot pull requests # and $RELEASE_VERSION which holds either the branch name or tag diff --git a/bin/image.sh b/bin/image.sh index 54025bd..80850a5 100755 --- a/bin/image.sh +++ b/bin/image.sh @@ -4,8 +4,8 @@ set -x set -eo pipefail WORKDIR=$(realpath $0 | xargs dirname | xargs dirname) -export FROM_IMAGE=${FROM_IMAGE:-php:8.1.7-fpm-buster} -PHP_VERSION=${PHP_VERSION:-8.1.7} +export FROM_IMAGE=${FROM_IMAGE:-php:8.2.18-fpm-bookworm} +PHP_VERSION=${PHP_VERSION:-8.2.18} VERSION=${VERSION:-`cat $WORKDIR/VERSION`} IMAGE_NAME=${IMAGE_NAME:-local/claranet/php} IMAGE_TAG=${IMAGE_TAG:-$VERSION-php$PHP_VERSION} @@ -41,6 +41,7 @@ case "$1" in build_image ${IMAGE} ;; test) + echo ${IMAGE} test_image ${IMAGE} ;; publish) diff --git a/docker/common.inc.sh b/docker/common.inc.sh index b7ec061..fa5585d 100644 --- a/docker/common.inc.sh +++ b/docker/common.inc.sh @@ -140,6 +140,24 @@ install_packages() { done fi + if [ "$DIST" = "bullseye" ]; then + sectionText "Found bullseye distribution, map package names" + for r in $BULLSEYE_PACKAGE_MAP; do + local from=`echo "$r" | cut -d: -f1` + local to=`echo "$r" | cut -d: -f2` + pkg_list=`echo "$pkg_list" | sed "s/$from/$to/g"` + done + fi + + if [ "$DIST" = "bookworm" ]; then + sectionText "Found bookworm distribution, map package names" + for r in $BOOKWORM_PACKAGE_MAP; do + local from=`echo "$r" | cut -d: -f1` + local to=`echo "$r" | cut -d: -f2` + pkg_list=`echo "$pkg_list" | sed "s/$from/$to/g"` + done + fi + if [ -n "$pkg_list" ]; then sectionText "Install $package_description: $pkg_list" http_proxy=$PROXY eatmydata apt-get install $install_flags $pkg_list &>> $BUILD_LOG diff --git a/example/matomo/Dockerfile b/example/matomo/Dockerfile index b7ecef8..608ad80 100644 --- a/example/matomo/Dockerfile +++ b/example/matomo/Dockerfile @@ -3,7 +3,7 @@ FROM ${IMAGE} ENV DOCUMENT_ROOT="${WORKDIR}" \ COMPRESS_FILE_PATHS="js" -ENV MATOMO_VERSION="3.5.1" \ +ENV MATOMO_VERSION="5.0.3" \ MYSQL_HOST="mysql" \ MYSQL_USER="matomouser"