ARG BASE_IMAGE=php:alpine FROM ${BASE_IMAGE} LABEL maintainer="dev@chialab.io" # Download script to install PHP extensions and dependencies ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions RUN apk add --no-cache \ coreutils \ curl \ git \ zip unzip \ # iconv, mbstring and pdo_sqlite are omitted as they are already installed && PHP_EXTENSIONS=" \ amqp \ bcmath \ bz2 \ calendar \ event \ exif \ gd \ gettext \ imagick \ intl \ ldap \ memcached \ mysqli \ opcache \ pdo_mysql \ pdo_pgsql \ pgsql \ redis \ soap \ sockets \ xsl \ zip \ " \ && case "$PHP_VERSION" in \ 5.6.*) PHP_EXTENSIONS="$PHP_EXTENSIONS mcrypt mysql";; \ 7.0.*|7.1.*) PHP_EXTENSIONS="$PHP_EXTENSIONS mcrypt";; \ esac \ && install-php-extensions $PHP_EXTENSIONS \ && if command -v a2enmod; then a2enmod rewrite; fi # Install Composer. ENV PATH=$PATH:/root/composer/vendor/bin \ COMPOSER_ALLOW_SUPERUSER=1 \ COMPOSER_HOME=/root/composer RUN cd /root \ # Download installer and check for its integrity. && curl -sSL https://getcomposer.org/installer > composer-setup.php \ && curl -sSL https://composer.github.io/installer.sha384sum > composer-setup.sha384sum \ && sha384sum --check composer-setup.sha384sum \ # Install Composer 2. && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --2 \ # Remove installer files. && rm /root/composer-setup.php /root/composer-setup.sha384sum