-
I'm using the official PHP docker image with Alpine. As far as I remember, an FROM php:7.4-cli-alpine
ARG BUILD_DEPENDENCIES="freetype-dev gettext-dev icu-dev imagemagick-dev libjpeg-turbo-dev libpng-dev libxml2-dev libxslt-dev libzip-dev oniguruma-dev openssl-dev pcre-dev pcre-dev vips-dev yaml-dev"
ARG PHP_DEPENDENCIES="ca-certificates icu-libs imagemagick libintl libxslt libzip openssl vips yaml"
ARG PHP_EXTENSIONS="bcmath ctype dom exif fileinfo gd intl mbstring mysqli pcntl pdo pdo_mysql sockets sqlite3 zip yaml"
ARG PECL_EXTENSIONS="imagick mcrypt redis"
...
RUN apk add --update --no-cache ${PHP_DEPENDENCIES} \
&& apk add --virtual build-dependencies --no-cache ${PHPIZE_DEPS} ${BUILD_DEPENDENCIES} \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) ${PHP_EXTENSIONS} \
&& pecl install ${PECL_EXTENSIONS} \
&& docker-php-ext-enable ${PECL_EXTENSIONS} \
&& apk del build-dependencies
...
COPY "./config/php/php.ini" "${PHP_INI_DIR}/php.ini" There are no settings related to extensions on my customized P.S. Do you approve of the way I made a distinction between build & runtime dependencies? + Am I missing something there or with pre-configurations? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This project is about the |
Beta Was this translation helpful? Give feedback.
-
No worries! PS: what about switching to |
Beta Was this translation helpful? Give feedback.
No worries!
PS: what about switching to
install-php-extensions
? You won't need to waste your time determining the dependencies required to build PHP extensions (I already did it for you for many extensions), and, after the extensions have been installed,install-php-extensions
uninstalls the system packages required only at build time (saving disk space).