Refactored PHP extension installation in Dockerfiles

The PHP extension installation commands have been refactored across multiple Dockerfiles. Previously, all extensions were installed in a single command. Now, each extension is installed with its own dedicated command. This change enhances readability and maintainability of the code.
This commit is contained in:
Jeroen De Meerleer 2024-11-08 12:08:45 +01:00
parent 9e52b3bec6
commit ccd2ba485c
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
3 changed files with 21 additions and 3 deletions

View File

@ -26,7 +26,13 @@ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/do
RUN set -eux; \ RUN set -eux; \
chmod uga+x /usr/local/bin/install-php-extensions && sync chmod uga+x /usr/local/bin/install-php-extensions && sync
RUN set -eux;install-php-extensions intl bcmath pdo_mysql opcache memcached pcntl zip RUN set -eux;install-php-extensions intl
RUN set -eux;install-php-extensions bcmath
RUN set -eux;install-php-extensions pdo_mysql
RUN set -eux;install-php-extensions opcache
RUN set -eux;install-php-extensions memcached
RUN set -eux;install-php-extensions pcntl
RUN set -eux;install-php-extensions zip
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

View File

@ -13,7 +13,13 @@ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/do
RUN set -eux; \ RUN set -eux; \
chmod uga+x /usr/local/bin/install-php-extensions && sync chmod uga+x /usr/local/bin/install-php-extensions && sync
RUN set -eux;install-php-extensions intl bcmath pdo_mysql opcache memcached pcntl zip RUN set -eux;install-php-extensions intl
RUN set -eux;install-php-extensions bcmath
RUN set -eux;install-php-extensions pdo_mysql
RUN set -eux;install-php-extensions opcache
RUN set -eux;install-php-extensions memcached
RUN set -eux;install-php-extensions pcntl
RUN set -eux;install-php-extensions zip
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

View File

@ -26,7 +26,13 @@ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/do
RUN set -eux; \ RUN set -eux; \
chmod uga+x /usr/local/bin/install-php-extensions && sync chmod uga+x /usr/local/bin/install-php-extensions && sync
RUN set -eux;install-php-extensions intl bcmath pdo_mysql opcache memcached pcntl zip RUN set -eux;install-php-extensions intl
RUN set -eux;install-php-extensions bcmath
RUN set -eux;install-php-extensions pdo_mysql
RUN set -eux;install-php-extensions opcache
RUN set -eux;install-php-extensions memcached
RUN set -eux;install-php-extensions pcntl
RUN set -eux;install-php-extensions zip
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"