Docker - How to disable PHP ext / modules -


i working on php api , disable unused php modules inside php-fpm image, such "sqlite3, pdo ..".

i docker beginner , know if there similar docker-php-ext-enable if not best practice disabling unused php modules.

yes that's possible.

taken https://hub.docker.com/_/php/

for example, if want have php-fpm image iconv, mcrypt , gd extensions, can inherit base image like, , write own dockerfile this:

from php:7.0-fpm run apt-get update && apt-get install -y \         libfreetype6-dev \         libjpeg62-turbo-dev \         libmcrypt-dev \        libpng12-dev \     && docker-php-ext-install -j$(nproc) iconv mcrypt \     && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \     && docker-php-ext-install -j$(nproc) gd 

remember, must install dependencies extensions manually. if extension needs custom configure arguments, can use docker-php-ext-configure script example.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -