If you use the official PHP image for Docker, you can install the extensions by running the docker-php-ext-install
command. If the extension has any prerequisites, it must be installed from its Dockerfile
before executing docker-php-ext-install
.
See an example from the image documentation:
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
About the extent of curl
, it is already enabled by default in the official image
root@58d96f139768:/# php -m
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
Since the image you are using is not based on the official image, I suggest you search for another image that is based on the official image, so it is easier for you to make these customizations.
You can take inspiration from in this tutorial here to create the containers for your application.