|
|
@ -1,20 +1,14 @@
|
|
|
|
#!/bin/bash
|
|
|
|
#!/bin/bash
|
|
|
|
set -ex -o errexit -o nounset -o pipefail
|
|
|
|
set -ex -o errexit -o nounset -o pipefail
|
|
|
|
|
|
|
|
|
|
|
|
# shellcheck disable=SC2223
|
|
|
|
declare -a pecl_extensions=()
|
|
|
|
: ${PHP_PECL_EXTENSIONS:=""}
|
|
|
|
readarray -d ' ' -t pecl_extensions < <(echo -n "${PHP_PECL_EXTENSIONS:-}")
|
|
|
|
|
|
|
|
readarray -d ' ' -t -O "${#pecl_extensions[@]}" pecl_extensions < <(echo -n "${PHP_PECL_EXTENSIONS_EXTRA:-}")
|
|
|
|
|
|
|
|
|
|
|
|
# shellcheck disable=SC2223
|
|
|
|
declare -a php_extensions=()
|
|
|
|
: ${PHP_PECL_EXTENSIONS_EXTRA:=""}
|
|
|
|
readarray -d ' ' -t php_extensions < <(echo -n "${PHP_EXTENSIONS:-}")
|
|
|
|
|
|
|
|
readarray -d ' ' -t -O "${#php_extensions[@]}" php_extensions < <(echo -n "${PHP_EXTENSIONS_EXTRA:-}")
|
|
|
|
# shellcheck disable=SC2223
|
|
|
|
readarray -d ' ' -t -O "${#php_extensions[@]}" php_extensions < <(echo -n "${PHP_EXTENSIONS_DATABASE:-}")
|
|
|
|
: ${PHP_EXTENSIONS:=""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# shellcheck disable=SC2223
|
|
|
|
|
|
|
|
: ${PHP_EXTENSIONS_EXTRA:=""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# shellcheck disable=SC2223
|
|
|
|
|
|
|
|
: ${PHP_EXTENSIONS_DATABASE:=""}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Grab the PHP source code so we can compile against it
|
|
|
|
# Grab the PHP source code so we can compile against it
|
|
|
|
docker-php-source extract
|
|
|
|
docker-php-source extract
|
|
|
@ -28,33 +22,21 @@ docker-php-ext-configure gd \
|
|
|
|
|
|
|
|
|
|
|
|
# Optional script folks can copy into their image to do any [docker-php-ext-configure] work before the [docker-php-ext-install]
|
|
|
|
# Optional script folks can copy into their image to do any [docker-php-ext-configure] work before the [docker-php-ext-install]
|
|
|
|
# this can also overwirte the [gd] configure above by simply running it again
|
|
|
|
# this can also overwirte the [gd] configure above by simply running it again
|
|
|
|
if [[ -f /install/php-extension-configure.sh ]]; then
|
|
|
|
declare -r custom_pre_configure_script=""
|
|
|
|
if [ ! -x "/install/php-extension-configure.sh" ]; then
|
|
|
|
if [[ -e "${custom_pre_configure_script}" ]]; then
|
|
|
|
echo >&2 "ERROR: found /install/php-extension-configure.sh but its not executable - please [chmod +x] the file!"
|
|
|
|
if [ ! -x "${custom_pre_configure_script}" ]; then
|
|
|
|
|
|
|
|
echo >&2 "ERROR: found ${custom_pre_configure_script} but its not executable - please [chmod +x] the file!"
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
/install/php-extension-configure.sh
|
|
|
|
"${custom_pre_configure_script}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Install pecl extensions
|
|
|
|
# Install pecl extensions
|
|
|
|
pecl install "${PHP_PECL_EXTENSIONS}" "${PHP_PECL_EXTENSIONS_EXTRA}"
|
|
|
|
pecl install "${pecl_extensions[@]}"
|
|
|
|
|
|
|
|
|
|
|
|
# PHP extensions (dependencies)
|
|
|
|
# PHP extensions (dependencies)
|
|
|
|
#
|
|
|
|
docker-php-ext-install -j "$(nproc)" "${php_extensions[@]}"
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
|
|
|
|
docker-php-ext-install \
|
|
|
|
|
|
|
|
-j "$(nproc)" \
|
|
|
|
|
|
|
|
${PHP_EXTENSIONS} \
|
|
|
|
|
|
|
|
${PHP_EXTENSIONS_EXTRA} \
|
|
|
|
|
|
|
|
${PHP_EXTENSIONS_DATABASE}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Enable all extensions
|
|
|
|
# Enable all extensions
|
|
|
|
#
|
|
|
|
docker-php-ext-enable "${pecl_extensions[@]}" "${php_extensions[@]}"
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
|
|
|
|
docker-php-ext-enable \
|
|
|
|
|
|
|
|
${PHP_PECL_EXTENSIONS} \
|
|
|
|
|
|
|
|
${PHP_PECL_EXTENSIONS_EXTRA} \
|
|
|
|
|
|
|
|
${PHP_EXTENSIONS} \
|
|
|
|
|
|
|
|
${PHP_EXTENSIONS_EXTRA} \
|
|
|
|
|
|
|
|
${PHP_EXTENSIONS_DATABASE}
|
|
|
|
|
|
|
|