


Warning: by using this method you may use an outdated version of the mlocati/php-extension-installer image. Gd xdebug Copying the script from a Docker image FROM php:7.2-cli COPY -from =mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ RUN install-php-extensions gd xdebug

Install-php-extensions gd xdebug Direct execution with curl FROM php:8.2-cli RUN curl -sSL -o - | sh -s \ o /usr/local/bin/install-php-extensions \Ĭhmod +x /usr/local/bin/install-php-extensions & \ Install-php-extensions gd xdebug Downloading the script on the fly with curl FROM php:7.2-cli RUN curl -sSLf \ Here's a list of sample Dockerfiles that install the GD and xdebug PHP extensions: Downloading the script on the fly with ADD FROM php:7.2-cli ADD /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions & \ You have many ways to use this script within your Dockerfiles. See also the notes in the Special requirements section. Supported docker images are all the Alpine/Debian versions, except for PHP 5.5 where we only support Debian 8 (jessie) (that is, php:5.5, php:5.5-apache, php:5.5-cli, php:5.5-fpm, php:5.5-zts). The script will install all the required APT/APK packages at the end of the script execution, the no-more needed packages will be removed so that the image will be much smaller. This repository contains a script that can be used to easily install a PHP extension inside the official PHP Docker images. Easy installation of PHP extensions in official PHP Docker images
