Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion images/constants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ variables:
php82osFlavors: bullseye
php83osFlavors: bullseye,bookworm
php84osFlavors: bullseye,bookworm
php85osFlavors: noble
osFlavors: bullseye,bookworm,noble
dotnetosFlavors: bookworm,bullseye,noble
nodejsosFlavors: bookworm,bullseye,noble
phposFlavors: bookworm,bullseye
phposFlavors: bookworm,bullseye,noble
pythonosFlavors: bookworm,bullseye,noble
cliDebianFlavors: bullseye
cliBuilderDebianFlavors: bullseye
Expand Down Expand Up @@ -69,6 +70,8 @@ variables:
php83Version_SHA: f7950ca034b15a78f5de9f1b22f4d9bad1dd497114d175cb1672a4ca78077af5
php84Version: 8.4.16
php84Version_SHA: f66f8f48db34e9e29f7bfd6901178e9cf4a1b163e6e497716dfcb8f88bcfae30
php85Version: 8.5.1
php85Version_SHA: 3f5bf99ce81201f526d25e288eddb2cfa111d068950d1e9a869530054ff98815
python39Version: 3.9.24
python310Version: 3.10.19
python311Version: 3.11.14
Expand Down
4 changes: 4 additions & 0 deletions images/runtime/build_runtime_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ case $stack_name in
"8.4")
docker build -f ./images/runtime/php-fpm/8.4/$os_flavor.Dockerfile -t phpfpm84_image_$os_flavor --build-arg PHP_VERSION=$php84Version --build-arg PHP_SHA256=$php84Version_SHA --build-arg BASE_IMAGE="docker.io/library/oryx_php_fpm_run_base_$os_flavor" --build-arg USER_DOTNET_AI_VERSION=$USER_DOTNET_AI_VERSION --build-arg AI_CONNECTION_STRING=$AI_CONNECTION_STRING .
;;

"8.5")
docker build -f ./images/runtime/php-fpm/8.5/$os_flavor.Dockerfile -t phpfpm85_image_$os_flavor --build-arg PHP_VERSION=$php85Version --build-arg PHP_SHA256=$php85Version_SHA --build-arg BASE_IMAGE="docker.io/library/oryx_php_fpm_run_base_$os_flavor" --build-arg USER_DOTNET_AI_VERSION=$USER_DOTNET_AI_VERSION --build-arg AI_CONNECTION_STRING=$AI_CONNECTION_STRING .
;;
esac
;;

Expand Down
5 changes: 4 additions & 1 deletion images/runtime/commonbase/phpFpmRuntimeBase.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ ENV PHPIZE_DEPS \
re2c

# persistent / runtime deps
# Note: libjpeg62-turbo-dev is for Debian, libjpeg-turbo8-dev is for Ubuntu
ARG OS_TYPE=debian
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
Expand All @@ -34,6 +36,8 @@ RUN set -eux; \
libzip-dev \
libpng-dev \
libjpeg-dev \
$([ "$OS_TYPE" = "debian" ] && echo "libjpeg62-turbo-dev") \
$([ "$OS_TYPE" = "ubuntu" ] && echo "libjpeg-turbo8-dev") \
libpq-dev \
libldap2-dev \
libldb-dev \
Expand All @@ -54,7 +58,6 @@ RUN set -eux; \
libedit-dev \
libsodium-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libonig-dev \
libcurl4-openssl-dev \
libldap2-dev \
Expand Down
71 changes: 0 additions & 71 deletions images/runtime/commonbase/phpRuntimeBase.Dockerfile

This file was deleted.

9 changes: 9 additions & 0 deletions images/runtime/php-fpm/8.5/docker-php-entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- php-fpm "$@"
fi

exec "$@"
69 changes: 69 additions & 0 deletions images/runtime/php-fpm/8.5/docker-php-ext-configure
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/bin/sh
set -e

# prefer user supplied CFLAGS, but default to our PHP_CFLAGS
: ${CFLAGS:=$PHP_CFLAGS}
: ${CPPFLAGS:=$PHP_CPPFLAGS}
: ${LDFLAGS:=$PHP_LDFLAGS}
export CFLAGS CPPFLAGS LDFLAGS

srcExists=
if [ -d /usr/src/php ]; then
srcExists=1
fi
docker-php-source extract
if [ -z "$srcExists" ]; then
touch /usr/src/php/.docker-delete-me
fi

cd /usr/src/php/ext

usage() {
echo "usage: $0 ext-name [configure flags]"
echo " ie: $0 gd --with-jpeg-dir=/usr/local/something"
echo
echo 'Possible values for ext-name:'
find . \
-mindepth 2 \
-maxdepth 2 \
-type f \
-name 'config.m4' \
| xargs -n1 dirname \
| xargs -n1 basename \
| sort \
| xargs
echo
echo 'Some of the above modules are already compiled into PHP; please check'
echo 'the output of "php -i" to see which modules are already loaded.'
}

ext="$1"
if [ -z "$ext" ] || [ ! -d "$ext" ]; then
usage >&2
exit 1
fi
shift

pm='unknown'
if [ -e /lib/apk/db/installed ]; then
pm='apk'
fi

if [ "$pm" = 'apk' ]; then
if \
[ -n "$PHPIZE_DEPS" ] \
&& ! apk info --installed .phpize-deps > /dev/null \
&& ! apk info --installed .phpize-deps-configure > /dev/null \
; then
apk add --no-cache --virtual .phpize-deps-configure $PHPIZE_DEPS
fi
fi

if command -v dpkg-architecture > /dev/null; then
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"
set -- --build="$gnuArch" "$@"
fi

cd "$ext"
phpize
./configure --enable-option-checking=fatal "$@"
114 changes: 114 additions & 0 deletions images/runtime/php-fpm/8.5/docker-php-ext-enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#!/bin/sh
set -e

extDir="$(php -d 'display_errors=stderr' -r 'echo ini_get("extension_dir");')"
cd "$extDir"

usage() {
echo "usage: $0 [options] module-name [module-name ...]"
echo " ie: $0 gd mysqli"
echo " $0 pdo pdo_mysql"
echo " $0 --ini-name 0-apc.ini apcu apc"
echo
echo 'Possible values for module-name:'
find -maxdepth 1 \
-type f \
-name '*.so' \
-exec basename '{}' ';' \
| sort \
| xargs
echo
echo 'Some of the above modules are already compiled into PHP; please check'
echo 'the output of "php -i" to see which modules are already loaded.'
}

opts="$(getopt -o 'h?' --long 'help,ini-name:' -- "$@" || { usage >&2 && false; })"
eval set -- "$opts"

iniName=
while true; do
flag="$1"
shift
case "$flag" in
--help|-h|'-?') usage && exit 0 ;;
--ini-name) iniName="$1" && shift ;;
--) break ;;
*)
{
echo "error: unknown flag: $flag"
usage
} >&2
exit 1
;;
esac
done

modules=
for module; do
if [ -z "$module" ]; then
continue
fi
if [ -f "$module.so" ] && ! [ -f "$module" ]; then
# allow ".so" to be optional
module="$module.so"
fi
if ! [ -f "$module" ]; then
echo >&2 "error: '$module' does not exist"
echo >&2
usage >&2
exit 1
fi
modules="$modules $module"
done

if [ -z "$modules" ]; then
usage >&2
exit 1
fi

pm='unknown'
if [ -e /lib/apk/db/installed ]; then
pm='apk'
fi

apkDel=
if [ "$pm" = 'apk' ]; then
if \
[ -n "$PHPIZE_DEPS" ] \
&& ! apk info --installed .phpize-deps > /dev/null \
&& ! apk info --installed .phpize-deps-configure > /dev/null \
; then
apk add --no-cache --virtual '.docker-php-ext-enable-deps' binutils
apkDel='.docker-php-ext-enable-deps'
fi
fi

for module in $modules; do
if readelf --wide --syms "$module" | grep -q ' zend_extension_entry$'; then
# https://wiki.php.net/internals/extensions#loading_zend_extensions
absModule="$(readlink -f "$module")"
line="zend_extension=$absModule"
else
line="extension=$module"
fi

ext="$(basename "$module")"
ext="${ext%.*}"
if php -d 'display_errors=stderr' -r 'exit(extension_loaded("'"$ext"'") ? 0 : 1);'; then
# this isn't perfect, but it's better than nothing
# (for example, 'opcache.so' presents inside PHP as 'Zend OPcache', not 'opcache')
echo >&2
echo >&2 "warning: $ext ($module) is already loaded!"
echo >&2
continue
fi

ini="$PHP_INI_DIR/conf.d/${iniName:-"docker-php-ext-$ext.ini"}"
if ! grep -q "$line" "$ini" 2>/dev/null; then
echo "$line" >> "$ini"
fi
done

if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then
apk del --no-network $apkDel
fi
Loading
Loading