I am working on a PHP API and I would like to disable unused php Modules inside my PHP-FPM image, such as "sqlite3, pdo ..".
I am a docker beginner and I would like to know if is there anything similar to
Yes that's possible.
Taken from https://hub.docker.com/_/php/
For example, if you want to have a PHP-FPM image with
gdextensions, you can inherit the base image that you like, and write your own Dockerfile like 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, you must install dependencies for your extensions manually. If an extension needs custom
configurearguments, you can use the
docker-php-ext-configurescript like this example.