diff --git a/.travis.yml b/.travis.yml index e496a704..956f9916 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,6 @@ env: - secure: ClsghGGhXXVK3pzy338YXGMz/h3TrfXlpTGrZTqWpNdNT4HDsqR5Hjd1nrYeAuA3Hf0o9cDUYaUdBkZx0GBorC81XNowpbFRMyVzPtniZazB1fDpI29AjTMNC73tPF0ANwo2rrmoIx0ca/vIkJuQk1fn7gfKbdVVlZEsD86buJ3W7f7Y3AA6rWVH1R01iwzoLqLv4UCELLNlHS52JHvPqe8cYuMaFhivm3qUGC/m9R/uG31OW+k9fJ4i/rJGgJlkP1eUI0l1bxKnePR0dccbRCv11k4iXFyoV4yvzxi1aO/S/gOnye8RzaSfXvYuKKN4Ge6pN7VO8nVlt3SfZDMgSVyGiOh2AJEjAoc+Itz48dHH4D8NfvbDi4EphftHxM5qqc1T8WKEkoXoBynJJydTlDdkb4dr3geCwo2ps38YnQ0y/JxXFigRzWRF8V3CiZ5bgRXCQiIWD37TmoFv8JYPWGpD8Xs7DJLiDOUEVvARmaeqptW73RxXUfTnd+KD6G0WBcz4tYVSauXyHlOpKPxV0k/+yG5G2ikSvkkf/2Mafut4+5Gy9TMYUXw6C2i2+eGXTpFDDQsoDbZ4dRqrVzrunaXNm3DbPyiE38BCVXwYmz6EQUDoKKlV7d3+Zr/5Kfw8hbXvflGSTQt87M4WDh0FbLhAm2cGPoP5PDzF8lm+txc= - secure: JssDXVzbu3gScW92+C/ZdSDODXV79PDx4IekkCYH6+OFPNLJSF9n14js6LtMJurKZp7F7VpqUO4gNyQ9y4HVRQJPhB7nzOy2SH77AWcwK2tmTGVB7MBK19E/d8xLBuDQWziVBIOCjW5gHpffBhT0SgBeZ5kxy15hVCZrce65bxlycGd+5DRGSd4zz6u+eGIc+eKWYgTSbfKRmWRC4QQVi87wiR9Efp7ywTEjKutMg9zFXTvPNoeaUbQJQgx2ZeGOY/THB0jXL9jkYgnvDq5sowDaSjd7DTEAWy5PdKh0zCIv8lLrO+mWiVOzGpKwRwVatPHsfzbuvl51ZIp6XvphURRpgu/+1x+Spm/Y+twzXzzeJenIJsJdPFZ4j5g34NsVHc+RnjIhB51g/+VPpW/Rid1+tWYp9v+QtUxMq7p7ZStwE/17Bi9+wVbACvUuHlyenr+hEXr2JCmv0Jj7F0P5+GgLSE3h3yitgUU+nJ6qwdmGzyZ3WQp8KklyumhbfOLIMvJ811Ayp8aV12dcp+hGIl5D7XSHdwZ4PK4wnB3oJiPaBB/HGS6/Tcav+cN8E39f6DjISlPHGXidfxQl3XuMOBOi6U6/eInWCRD1hTqzRtJMieboz8OOh9KcUQq8XhoqTbh2zCKRY+wgoOqLzHs9Dbd1cJAu0CvDX6jIuR3FqUA= matrix: - - VARIANT="cli" - PHP_VERSION="7.4" - - VARIANT="apache" - PHP_VERSION="7.4" - - VARIANT="fpm" - PHP_VERSION="7.4" - VARIANT="cli" PHP_VERSION="7.3" - VARIANT="apache" diff --git a/Dockerfile.fpm b/Dockerfile.7.1.apache similarity index 78% rename from Dockerfile.fpm rename to Dockerfile.7.1.apache index 8621add5..bd00ec07 100644 --- a/Dockerfile.fpm +++ b/Dockerfile.7.1.apache @@ -1,11 +1,10 @@ ARG INSTALL_CRON=1 ARG INSTALL_COMPOSER=1 -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-slim-fpm +FROM thecodingmachine/php:7.1-v2-slim-apache LABEL authors="Julien Neuhart , David Négrier " + # |-------------------------------------------------------------------------- # | Main PHP extensions # |-------------------------------------------------------------------------- @@ -18,11 +17,14 @@ RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all. USER docker # |-------------------------------------------------------------------------- -# | Default PHP extensions to be enabled (in addition to the one declared in Slim build) +# | Default PHP extensions to be enabled # |-------------------------------------------------------------------------- ENV PHP_EXTENSION_APCU=1 \ PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ PHP_EXTENSION_PDO_MYSQL=1 \ - PHP_EXTENSION_IGBINARY=1 \ PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.cli.node10 b/Dockerfile.7.1.apache.node10 similarity index 86% rename from Dockerfile.cli.node10 rename to Dockerfile.7.1.apache.node10 index 2f1739f9..a06eaebd 100644 --- a/Dockerfile.cli.node10 +++ b/Dockerfile.7.1.apache.node10 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-cli +FROM thecodingmachine/php:7.1-v2-apache LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.fpm.node12 b/Dockerfile.7.1.apache.node12 similarity index 86% rename from Dockerfile.fpm.node12 rename to Dockerfile.7.1.apache.node12 index 26fcd146..7a5eee15 100644 --- a/Dockerfile.fpm.node12 +++ b/Dockerfile.7.1.apache.node12 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-fpm +FROM thecodingmachine/php:7.1-v2-apache LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.fpm.node8 b/Dockerfile.7.1.apache.node8 similarity index 86% rename from Dockerfile.fpm.node8 rename to Dockerfile.7.1.apache.node8 index d150ff4e..1b664517 100644 --- a/Dockerfile.fpm.node8 +++ b/Dockerfile.7.1.apache.node8 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-fpm +FROM thecodingmachine/php:7.1-v2-apache LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.cli b/Dockerfile.7.1.cli similarity index 78% rename from Dockerfile.cli rename to Dockerfile.7.1.cli index 5c8662dd..9f898662 100644 --- a/Dockerfile.cli +++ b/Dockerfile.7.1.cli @@ -1,11 +1,10 @@ ARG INSTALL_CRON=1 ARG INSTALL_COMPOSER=1 -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-slim-cli +FROM thecodingmachine/php:7.1-v2-slim-cli LABEL authors="Julien Neuhart , David Négrier " + # |-------------------------------------------------------------------------- # | Main PHP extensions # |-------------------------------------------------------------------------- @@ -18,11 +17,14 @@ RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all. USER docker # |-------------------------------------------------------------------------- -# | Default PHP extensions to be enabled (in addition to the one declared in Slim build) +# | Default PHP extensions to be enabled # |-------------------------------------------------------------------------- ENV PHP_EXTENSION_APCU=1 \ PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ PHP_EXTENSION_PDO_MYSQL=1 \ - PHP_EXTENSION_IGBINARY=1 \ PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.fpm.node10 b/Dockerfile.7.1.cli.node10 similarity index 86% rename from Dockerfile.fpm.node10 rename to Dockerfile.7.1.cli.node10 index 63ed96ef..2aec96c9 100644 --- a/Dockerfile.fpm.node10 +++ b/Dockerfile.7.1.cli.node10 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-fpm +FROM thecodingmachine/php:7.1-v2-cli LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.cli.node12 b/Dockerfile.7.1.cli.node12 similarity index 86% rename from Dockerfile.cli.node12 rename to Dockerfile.7.1.cli.node12 index d68fa8d2..8b421e9f 100644 --- a/Dockerfile.cli.node12 +++ b/Dockerfile.7.1.cli.node12 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-cli +FROM thecodingmachine/php:7.1-v2-cli LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.cli.node8 b/Dockerfile.7.1.cli.node8 similarity index 86% rename from Dockerfile.cli.node8 rename to Dockerfile.7.1.cli.node8 index fde41468..34aea266 100644 --- a/Dockerfile.cli.node8 +++ b/Dockerfile.7.1.cli.node8 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-cli +FROM thecodingmachine/php:7.1-v2-cli LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.apache b/Dockerfile.7.1.fpm similarity index 78% rename from Dockerfile.apache rename to Dockerfile.7.1.fpm index 41b5b0b5..7f1a0560 100644 --- a/Dockerfile.apache +++ b/Dockerfile.7.1.fpm @@ -1,11 +1,10 @@ ARG INSTALL_CRON=1 ARG INSTALL_COMPOSER=1 -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-slim-apache +FROM thecodingmachine/php:7.1-v2-slim-fpm LABEL authors="Julien Neuhart , David Négrier " + # |-------------------------------------------------------------------------- # | Main PHP extensions # |-------------------------------------------------------------------------- @@ -18,11 +17,14 @@ RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all. USER docker # |-------------------------------------------------------------------------- -# | Default PHP extensions to be enabled (in addition to the one declared in Slim build) +# | Default PHP extensions to be enabled # |-------------------------------------------------------------------------- ENV PHP_EXTENSION_APCU=1 \ PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ PHP_EXTENSION_PDO_MYSQL=1 \ - PHP_EXTENSION_IGBINARY=1 \ PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.apache.node10 b/Dockerfile.7.1.fpm.node10 similarity index 86% rename from Dockerfile.apache.node10 rename to Dockerfile.7.1.fpm.node10 index 2a2e087c..c61428fe 100644 --- a/Dockerfile.apache.node10 +++ b/Dockerfile.7.1.fpm.node10 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-apache +FROM thecodingmachine/php:7.1-v2-fpm LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.apache.node12 b/Dockerfile.7.1.fpm.node12 similarity index 86% rename from Dockerfile.apache.node12 rename to Dockerfile.7.1.fpm.node12 index fbdb151a..8b1eabf3 100644 --- a/Dockerfile.apache.node12 +++ b/Dockerfile.7.1.fpm.node12 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-apache +FROM thecodingmachine/php:7.1-v2-fpm LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.apache.node8 b/Dockerfile.7.1.fpm.node8 similarity index 86% rename from Dockerfile.apache.node8 rename to Dockerfile.7.1.fpm.node8 index e4cdf049..02e8a336 100644 --- a/Dockerfile.apache.node8 +++ b/Dockerfile.7.1.fpm.node8 @@ -1,6 +1,4 @@ -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-apache +FROM thecodingmachine/php:7.1-v2-fpm LABEL authors="Julien Neuhart , David Négrier " diff --git a/Dockerfile.slim.cli b/Dockerfile.7.1.slim.apache similarity index 67% rename from Dockerfile.slim.cli rename to Dockerfile.7.1.slim.apache index 2556bb14..c6af6ac0 100644 --- a/Dockerfile.slim.cli +++ b/Dockerfile.7.1.slim.apache @@ -1,15 +1,7 @@ -FROM ubuntu:bionic +FROM php:7.1-apache-stretch LABEL authors="Julien Neuhart , David Négrier " -# Fixes some weird terminal issues such as broken clear / CTRL+L -#ENV TERM=linux - -# Ensure apt doesn't ask questions when installing stuff -ENV DEBIAN_FRONTEND=noninteractive - -ARG PHP_VERSION -ENV PHP_VERSION=$PHP_VERSION # |-------------------------------------------------------------------------- # | Main PHP extensions @@ -18,32 +10,13 @@ ENV PHP_VERSION=$PHP_VERSION # | Installs the main PHP extensions # | -# Install php an other packages -RUN apt-get update \ - && apt-get install -y --no-install-recommends gnupg \ - && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - git \ - nano \ - sudo \ - iproute2 \ - openssh-client \ - procps \ - unzip \ - ca-certificates \ - curl \ - php${PHP_VERSION}-cli \ - php${PHP_VERSION}-curl \ - php${PHP_VERSION}-json \ - php${PHP_VERSION}-mbstring \ - php${PHP_VERSION}-opcache \ - php${PHP_VERSION}-readline \ - php${PHP_VERSION}-xml \ - php${PHP_VERSION}-zip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.1 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini # |-------------------------------------------------------------------------- # | User @@ -63,16 +36,11 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # | Let's download php.ini for prod and development # | -#ADD https://raw.githubusercontent.com/php/php-src/PHP-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production -#ADD https://raw.githubusercontent.com/php/php-src/PHP-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development -#RUN chmod 644 /usr/local/etc/php/php.ini-* - +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* ENV TEMPLATE_PHP_INI=development -# Let's remove the default php.ini file (it will be copied from TEMPLATE_PHP_INI) -RUN rm /etc/php/${PHP_VERSION}/cli/php.ini - - # |-------------------------------------------------------------------------- # | Composer # |-------------------------------------------------------------------------- @@ -89,41 +57,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local COPY utils/utils.php /usr/local/bin/utils.php COPY utils/composer_proxy.sh /usr/local/bin/composer COPY utils/generate_conf.php /usr/local/bin/generate_conf.php -COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php -# |-------------------------------------------------------------------------- -# | Default PHP extensions to be enabled -# | By default, enable all the extensions that are enabled on a base Ubuntu install -# |-------------------------------------------------------------------------- -ENV PHP_EXTENSION_CALENDAR=1 \ - PHP_EXTENSION_CTYPE=1 \ - PHP_EXTENSION_CURL=1 \ - PHP_EXTENSION_DOM=1 \ - PHP_EXTENSION_EXIF=1 \ - PHP_EXTENSION_FILEINFO=1 \ - PHP_EXTENSION_FTP=1 \ - PHP_EXTENSION_GETTEXT=1 \ - PHP_EXTENSION_ICONV=1 \ - PHP_EXTENSION_JSON=1 \ - PHP_EXTENSION_MBSTRING=1 \ - PHP_EXTENSION_OPCACHE=1 \ - PHP_EXTENSION_PDO=1 \ - PHP_EXTENSION_PHAR=1 \ - PHP_EXTENSION_POSIX=1 \ - PHP_EXTENSION_READLINE=1 \ - PHP_EXTENSION_SHMOP=1 \ - PHP_EXTENSION_SIMPLEXML=1 \ - PHP_EXTENSION_SOCKETS=1 \ - PHP_EXTENSION_SYSVMSG=1 \ - PHP_EXTENSION_SYSVSEM=1 \ - PHP_EXTENSION_SYSVSHM=1 \ - PHP_EXTENSION_TOKENIZER=1 \ - PHP_EXTENSION_WDDX=1 \ - PHP_EXTENSION_XML=1 \ - PHP_EXTENSION_XMLREADER=1 \ - PHP_EXTENSION_XMLWRITER=1 \ - PHP_EXTENSION_XSL=1 \ - PHP_EXTENSION_ZIP=1 # |-------------------------------------------------------------------------- # | prestissimo @@ -135,20 +69,29 @@ ENV PHP_EXTENSION_CALENDAR=1 \ USER docker RUN composer global require hirak/prestissimo && \ composer global require bamarni/symfony-console-autocomplete && \ - rm -rf ~/.composer + rm -rf $HOME\.composer USER root +ENV APACHE_DOCUMENT_ROOT / +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | +RUN a2enmod rewrite -RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app -WORKDIR /usr/src/app +RUN chown docker:docker /var/www/html # |-------------------------------------------------------------------------- @@ -206,9 +149,9 @@ RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/ # | Defines the entrypoint. # | -ENV IMAGE_VARIANT=cli +ENV IMAGE_VARIANT=apache -# Add Tini (to be able to stop the container with ctrl-c). +# Add Tini (to be able to stop the container with ctrl-c. # See: https://github.com/krallin/tini ENV TINI_VERSION v0.16.1 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini @@ -217,30 +160,43 @@ RUN chmod +x /tini COPY utils/generate_cron.php /usr/local/bin/generate_cron.php COPY utils/startup_commands.php /usr/local/bin/startup_commands.php +COPY utils/enable_apache_mods.php /usr/local/bin/enable_apache_mods.php +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh -COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions -RUN ln -s ${PHP_VERSION} /usr/local/lib/thecodingmachine-php/extensions/current - ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +CMD ["apache2-foreground"] + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. Bu default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | -CMD ["php", "-v"] +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker -RUN touch /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini && ln -s /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini /etc/php/${PHP_VERSION}/cli/conf.d/generated_conf.ini USER docker COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php -COPY utils/install_selected_extensions.sh /usr/local/bin/install_selected_extensions.sh ONBUILD ARG PHP_EXTENSIONS ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" -ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_selected_extensions.sh +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php # |-------------------------------------------------------------------------- # | Supercronic diff --git a/Dockerfile.7.1.slim.cli b/Dockerfile.7.1.slim.cli new file mode 100644 index 00000000..11d0005b --- /dev/null +++ b/Dockerfile.7.1.slim.cli @@ -0,0 +1,208 @@ +FROM php:7.1-cli-stretch + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.1 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini + +# |-------------------------------------------------------------------------- +# | User +# |-------------------------------------------------------------------------- +# | +# | Define a default user with sudo rights. +# | + +RUN useradd -ms /bin/bash docker && adduser docker sudo +# Users in the sudoers group can sudo as root without password. +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Default php.ini file +# |-------------------------------------------------------------------------- +# | +# | Let's download php.ini for prod and development +# | + +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* +ENV TEMPLATE_PHP_INI=development + +# |-------------------------------------------------------------------------- +# | Composer +# |-------------------------------------------------------------------------- +# | +# | Installs Composer to easily manage your PHP dependencies. +# | + +#ENV COMPOSER_ALLOW_SUPERUSER 1 + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=real_composer &&\ + chmod +x /usr/local/bin/real_composer + +# TODO: utils.php in /usr/local/bin... bof! +COPY utils/utils.php /usr/local/bin/utils.php +COPY utils/composer_proxy.sh /usr/local/bin/composer +COPY utils/generate_conf.php /usr/local/bin/generate_conf.php + + +# |-------------------------------------------------------------------------- +# | prestissimo +# |-------------------------------------------------------------------------- +# | +# | Installs Prestissimo to improve Composer download performance. +# | + +USER docker +RUN composer global require hirak/prestissimo && \ + composer global require bamarni/symfony-console-autocomplete && \ + rm -rf $HOME\.composer + +USER root + + + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./vendor/bin to the PATH (utility function to use Composer bin easily) +# | +ENV PATH="$PATH:./vendor/bin:~/.composer/vendor/bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./vendor/bin:~/.composer/vendor/bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | + +RUN echo 'eval "$(symfony-autocomplete)"' > ~/.bash_profile + +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | NodeJS path registration (if we install NodeJS, this is useful). +# | +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV IMAGE_VARIANT=cli + +# Add Tini (to be able to stop the container with ctrl-c. +# See: https://github.com/krallin/tini +ENV TINI_VERSION v0.16.1 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + +COPY utils/generate_cron.php /usr/local/bin/generate_cron.php +COPY utils/startup_commands.php /usr/local/bin/startup_commands.php + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + + +CMD ["php", "-v"] + + + +USER docker + +COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php + +ONBUILD ARG PHP_EXTENSIONS +ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +ONBUILD ARG INSTALL_CRON +ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \ + SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \ + && SUPERCRONIC=supercronic-linux-amd64 \ + && SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ + && chmod +x "$SUPERCRONIC" \ + && sudo mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && sudo ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic; \ + fi; + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. The later will allow you to easily manage +# | your frontend dependencies. +# | Also installs yarn. It provides some nice improvements over npm. +# | +ONBUILD ARG NODE_VERSION +ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo bash - && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends yarn; \ + fi; diff --git a/Dockerfile.7.1.slim.fpm b/Dockerfile.7.1.slim.fpm new file mode 100644 index 00000000..4c04918d --- /dev/null +++ b/Dockerfile.7.1.slim.fpm @@ -0,0 +1,207 @@ +FROM php:7.1-fpm-stretch + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.1 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini + +# |-------------------------------------------------------------------------- +# | User +# |-------------------------------------------------------------------------- +# | +# | Define a default user with sudo rights. +# | + +RUN useradd -ms /bin/bash docker && adduser docker sudo +# Users in the sudoers group can sudo as root without password. +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Default php.ini file +# |-------------------------------------------------------------------------- +# | +# | Let's download php.ini for prod and development +# | + +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* +ENV TEMPLATE_PHP_INI=development + +# |-------------------------------------------------------------------------- +# | Composer +# |-------------------------------------------------------------------------- +# | +# | Installs Composer to easily manage your PHP dependencies. +# | + +#ENV COMPOSER_ALLOW_SUPERUSER 1 + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=real_composer &&\ + chmod +x /usr/local/bin/real_composer + +# TODO: utils.php in /usr/local/bin... bof! +COPY utils/utils.php /usr/local/bin/utils.php +COPY utils/composer_proxy.sh /usr/local/bin/composer +COPY utils/generate_conf.php /usr/local/bin/generate_conf.php + + +# |-------------------------------------------------------------------------- +# | prestissimo +# |-------------------------------------------------------------------------- +# | +# | Installs Prestissimo to improve Composer download performance. +# | + +USER docker +RUN composer global require hirak/prestissimo && \ + composer global require bamarni/symfony-console-autocomplete && \ + rm -rf $HOME\.composer + +USER root + + + + + +RUN chown docker:docker /var/www/html + + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./vendor/bin to the PATH (utility function to use Composer bin easily) +# | +ENV PATH="$PATH:./vendor/bin:~/.composer/vendor/bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./vendor/bin:~/.composer/vendor/bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | + +RUN echo 'eval "$(symfony-autocomplete)"' > ~/.bash_profile + +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | NodeJS path registration (if we install NodeJS, this is useful). +# | +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV IMAGE_VARIANT=fpm + +# Add Tini (to be able to stop the container with ctrl-c. +# See: https://github.com/krallin/tini +ENV TINI_VERSION v0.16.1 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + +COPY utils/generate_cron.php /usr/local/bin/generate_cron.php +COPY utils/startup_commands.php /usr/local/bin/startup_commands.php + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + + + +CMD ["php-fpm"] + + +USER docker + +COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php + +ONBUILD ARG PHP_EXTENSIONS +ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +ONBUILD ARG INSTALL_CRON +ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \ + SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \ + && SUPERCRONIC=supercronic-linux-amd64 \ + && SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ + && chmod +x "$SUPERCRONIC" \ + && sudo mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && sudo ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic; \ + fi; + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. The later will allow you to easily manage +# | your frontend dependencies. +# | Also installs yarn. It provides some nice improvements over npm. +# | +ONBUILD ARG NODE_VERSION +ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo bash - && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends yarn; \ + fi; diff --git a/Dockerfile.7.2.apache b/Dockerfile.7.2.apache new file mode 100644 index 00000000..f721067e --- /dev/null +++ b/Dockerfile.7.2.apache @@ -0,0 +1,30 @@ +ARG INSTALL_CRON=1 +ARG INSTALL_COMPOSER=1 +FROM thecodingmachine/php:7.2-v2-slim-apache + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +USER root +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all.sh && ./disable_all.sh +USER docker + +# |-------------------------------------------------------------------------- +# | Default PHP extensions to be enabled +# |-------------------------------------------------------------------------- +ENV PHP_EXTENSION_APCU=1 \ + PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ + PHP_EXTENSION_PDO_MYSQL=1 \ + PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ + PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.7.2.apache.node10 b/Dockerfile.7.2.apache.node10 new file mode 100644 index 00000000..43499ad1 --- /dev/null +++ b/Dockerfile.7.2.apache.node10 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-apache + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.2.apache.node12 b/Dockerfile.7.2.apache.node12 new file mode 100644 index 00000000..6d2beb55 --- /dev/null +++ b/Dockerfile.7.2.apache.node12 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-apache + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.2.apache.node8 b/Dockerfile.7.2.apache.node8 new file mode 100644 index 00000000..2a0e3160 --- /dev/null +++ b/Dockerfile.7.2.apache.node8 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-apache + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.2.cli b/Dockerfile.7.2.cli new file mode 100644 index 00000000..7983b4cd --- /dev/null +++ b/Dockerfile.7.2.cli @@ -0,0 +1,30 @@ +ARG INSTALL_CRON=1 +ARG INSTALL_COMPOSER=1 +FROM thecodingmachine/php:7.2-v2-slim-cli + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +USER root +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all.sh && ./disable_all.sh +USER docker + +# |-------------------------------------------------------------------------- +# | Default PHP extensions to be enabled +# |-------------------------------------------------------------------------- +ENV PHP_EXTENSION_APCU=1 \ + PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ + PHP_EXTENSION_PDO_MYSQL=1 \ + PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ + PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.7.2.cli.node10 b/Dockerfile.7.2.cli.node10 new file mode 100644 index 00000000..f67fe0e6 --- /dev/null +++ b/Dockerfile.7.2.cli.node10 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-cli + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.2.cli.node12 b/Dockerfile.7.2.cli.node12 new file mode 100644 index 00000000..88d28c7f --- /dev/null +++ b/Dockerfile.7.2.cli.node12 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-cli + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.2.cli.node8 b/Dockerfile.7.2.cli.node8 new file mode 100644 index 00000000..7dc009b4 --- /dev/null +++ b/Dockerfile.7.2.cli.node8 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-cli + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.2.fpm b/Dockerfile.7.2.fpm new file mode 100644 index 00000000..979b29e6 --- /dev/null +++ b/Dockerfile.7.2.fpm @@ -0,0 +1,30 @@ +ARG INSTALL_CRON=1 +ARG INSTALL_COMPOSER=1 +FROM thecodingmachine/php:7.2-v2-slim-fpm + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +USER root +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all.sh && ./disable_all.sh +USER docker + +# |-------------------------------------------------------------------------- +# | Default PHP extensions to be enabled +# |-------------------------------------------------------------------------- +ENV PHP_EXTENSION_APCU=1 \ + PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ + PHP_EXTENSION_PDO_MYSQL=1 \ + PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ + PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.7.2.fpm.node10 b/Dockerfile.7.2.fpm.node10 new file mode 100644 index 00000000..863c2673 --- /dev/null +++ b/Dockerfile.7.2.fpm.node10 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-fpm + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.2.fpm.node12 b/Dockerfile.7.2.fpm.node12 new file mode 100644 index 00000000..142829ec --- /dev/null +++ b/Dockerfile.7.2.fpm.node12 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-fpm + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.2.fpm.node8 b/Dockerfile.7.2.fpm.node8 new file mode 100644 index 00000000..ef5d563a --- /dev/null +++ b/Dockerfile.7.2.fpm.node8 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.2-v2-fpm + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.slim.apache b/Dockerfile.7.2.slim.apache similarity index 67% rename from Dockerfile.slim.apache rename to Dockerfile.7.2.slim.apache index 81fb8e34..b92c6f69 100644 --- a/Dockerfile.slim.apache +++ b/Dockerfile.7.2.slim.apache @@ -1,15 +1,7 @@ -FROM ubuntu:bionic +FROM php:7.2-apache-stretch LABEL authors="Julien Neuhart , David Négrier " -# Fixes some weird terminal issues such as broken clear / CTRL+L -#ENV TERM=linux - -# Ensure apt doesn't ask questions when installing stuff -ENV DEBIAN_FRONTEND=noninteractive - -ARG PHP_VERSION -ENV PHP_VERSION=$PHP_VERSION # |-------------------------------------------------------------------------- # | Main PHP extensions @@ -18,32 +10,13 @@ ENV PHP_VERSION=$PHP_VERSION # | Installs the main PHP extensions # | -# Install php an other packages -RUN apt-get update \ - && apt-get install -y --no-install-recommends gnupg \ - && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - git \ - nano \ - sudo \ - iproute2 \ - openssh-client \ - procps \ - unzip \ - ca-certificates \ - curl \ - php${PHP_VERSION}-cli \ - php${PHP_VERSION}-curl \ - php${PHP_VERSION}-json \ - php${PHP_VERSION}-mbstring \ - php${PHP_VERSION}-opcache \ - php${PHP_VERSION}-readline \ - php${PHP_VERSION}-xml \ - php${PHP_VERSION}-zip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.2 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini # |-------------------------------------------------------------------------- # | User @@ -63,16 +36,11 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # | Let's download php.ini for prod and development # | -#ADD https://raw.githubusercontent.com/php/php-src/PHP-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production -#ADD https://raw.githubusercontent.com/php/php-src/PHP-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development -#RUN chmod 644 /usr/local/etc/php/php.ini-* - +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* ENV TEMPLATE_PHP_INI=development -# Let's remove the default php.ini file (it will be copied from TEMPLATE_PHP_INI) -RUN rm /etc/php/${PHP_VERSION}/cli/php.ini - - # |-------------------------------------------------------------------------- # | Composer # |-------------------------------------------------------------------------- @@ -89,41 +57,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local COPY utils/utils.php /usr/local/bin/utils.php COPY utils/composer_proxy.sh /usr/local/bin/composer COPY utils/generate_conf.php /usr/local/bin/generate_conf.php -COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php -# |-------------------------------------------------------------------------- -# | Default PHP extensions to be enabled -# | By default, enable all the extensions that are enabled on a base Ubuntu install -# |-------------------------------------------------------------------------- -ENV PHP_EXTENSION_CALENDAR=1 \ - PHP_EXTENSION_CTYPE=1 \ - PHP_EXTENSION_CURL=1 \ - PHP_EXTENSION_DOM=1 \ - PHP_EXTENSION_EXIF=1 \ - PHP_EXTENSION_FILEINFO=1 \ - PHP_EXTENSION_FTP=1 \ - PHP_EXTENSION_GETTEXT=1 \ - PHP_EXTENSION_ICONV=1 \ - PHP_EXTENSION_JSON=1 \ - PHP_EXTENSION_MBSTRING=1 \ - PHP_EXTENSION_OPCACHE=1 \ - PHP_EXTENSION_PDO=1 \ - PHP_EXTENSION_PHAR=1 \ - PHP_EXTENSION_POSIX=1 \ - PHP_EXTENSION_READLINE=1 \ - PHP_EXTENSION_SHMOP=1 \ - PHP_EXTENSION_SIMPLEXML=1 \ - PHP_EXTENSION_SOCKETS=1 \ - PHP_EXTENSION_SYSVMSG=1 \ - PHP_EXTENSION_SYSVSEM=1 \ - PHP_EXTENSION_SYSVSHM=1 \ - PHP_EXTENSION_TOKENIZER=1 \ - PHP_EXTENSION_WDDX=1 \ - PHP_EXTENSION_XML=1 \ - PHP_EXTENSION_XMLREADER=1 \ - PHP_EXTENSION_XMLWRITER=1 \ - PHP_EXTENSION_XSL=1 \ - PHP_EXTENSION_ZIP=1 # |-------------------------------------------------------------------------- # | prestissimo @@ -135,21 +69,15 @@ ENV PHP_EXTENSION_CALENDAR=1 \ USER docker RUN composer global require hirak/prestissimo && \ composer global require bamarni/symfony-console-autocomplete && \ - rm -rf ~/.composer + rm -rf $HOME\.composer USER root -ENV APACHE_DOCUMENT_ROOT= +ENV APACHE_DOCUMENT_ROOT / -RUN apt-get update \ - && apt-get install -y --no-install-recommends apache2 \ - libapache2-mod-php${PHP_VERSION} \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* - -RUN sed -ri -e 's!/var/www/html!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf # |-------------------------------------------------------------------------- # | Apache mod_rewrite @@ -163,12 +91,7 @@ RUN a2enmod rewrite - - - - RUN chown docker:docker /var/www/html -WORKDIR /var/www/html # |-------------------------------------------------------------------------- @@ -228,7 +151,7 @@ RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/ ENV IMAGE_VARIANT=apache -# Add Tini (to be able to stop the container with ctrl-c). +# Add Tini (to be able to stop the container with ctrl-c. # See: https://github.com/krallin/tini ENV TINI_VERSION v0.16.1 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini @@ -243,9 +166,6 @@ COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh -COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions -RUN ln -s ${PHP_VERSION} /usr/local/lib/thecodingmachine-php/extensions/current - ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] @@ -270,16 +190,13 @@ ENV APACHE_RUN_USER=docker \ -RUN touch /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini && ln -s /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini /etc/php/${PHP_VERSION}/cli/conf.d/generated_conf.ini - USER docker COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php -COPY utils/install_selected_extensions.sh /usr/local/bin/install_selected_extensions.sh ONBUILD ARG PHP_EXTENSIONS ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" -ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_selected_extensions.sh +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php # |-------------------------------------------------------------------------- # | Supercronic diff --git a/Dockerfile.7.2.slim.cli b/Dockerfile.7.2.slim.cli new file mode 100644 index 00000000..38777c9e --- /dev/null +++ b/Dockerfile.7.2.slim.cli @@ -0,0 +1,208 @@ +FROM php:7.2-cli-stretch + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.2 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini + +# |-------------------------------------------------------------------------- +# | User +# |-------------------------------------------------------------------------- +# | +# | Define a default user with sudo rights. +# | + +RUN useradd -ms /bin/bash docker && adduser docker sudo +# Users in the sudoers group can sudo as root without password. +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Default php.ini file +# |-------------------------------------------------------------------------- +# | +# | Let's download php.ini for prod and development +# | + +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* +ENV TEMPLATE_PHP_INI=development + +# |-------------------------------------------------------------------------- +# | Composer +# |-------------------------------------------------------------------------- +# | +# | Installs Composer to easily manage your PHP dependencies. +# | + +#ENV COMPOSER_ALLOW_SUPERUSER 1 + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=real_composer &&\ + chmod +x /usr/local/bin/real_composer + +# TODO: utils.php in /usr/local/bin... bof! +COPY utils/utils.php /usr/local/bin/utils.php +COPY utils/composer_proxy.sh /usr/local/bin/composer +COPY utils/generate_conf.php /usr/local/bin/generate_conf.php + + +# |-------------------------------------------------------------------------- +# | prestissimo +# |-------------------------------------------------------------------------- +# | +# | Installs Prestissimo to improve Composer download performance. +# | + +USER docker +RUN composer global require hirak/prestissimo && \ + composer global require bamarni/symfony-console-autocomplete && \ + rm -rf $HOME\.composer + +USER root + + + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./vendor/bin to the PATH (utility function to use Composer bin easily) +# | +ENV PATH="$PATH:./vendor/bin:~/.composer/vendor/bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./vendor/bin:~/.composer/vendor/bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | + +RUN echo 'eval "$(symfony-autocomplete)"' > ~/.bash_profile + +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | NodeJS path registration (if we install NodeJS, this is useful). +# | +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV IMAGE_VARIANT=cli + +# Add Tini (to be able to stop the container with ctrl-c. +# See: https://github.com/krallin/tini +ENV TINI_VERSION v0.16.1 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + +COPY utils/generate_cron.php /usr/local/bin/generate_cron.php +COPY utils/startup_commands.php /usr/local/bin/startup_commands.php + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + + +CMD ["php", "-v"] + + + +USER docker + +COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php + +ONBUILD ARG PHP_EXTENSIONS +ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +ONBUILD ARG INSTALL_CRON +ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \ + SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \ + && SUPERCRONIC=supercronic-linux-amd64 \ + && SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ + && chmod +x "$SUPERCRONIC" \ + && sudo mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && sudo ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic; \ + fi; + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. The later will allow you to easily manage +# | your frontend dependencies. +# | Also installs yarn. It provides some nice improvements over npm. +# | +ONBUILD ARG NODE_VERSION +ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo bash - && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends yarn; \ + fi; diff --git a/Dockerfile.7.2.slim.fpm b/Dockerfile.7.2.slim.fpm new file mode 100644 index 00000000..657a608d --- /dev/null +++ b/Dockerfile.7.2.slim.fpm @@ -0,0 +1,207 @@ +FROM php:7.2-fpm-stretch + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.2 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini + +# |-------------------------------------------------------------------------- +# | User +# |-------------------------------------------------------------------------- +# | +# | Define a default user with sudo rights. +# | + +RUN useradd -ms /bin/bash docker && adduser docker sudo +# Users in the sudoers group can sudo as root without password. +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Default php.ini file +# |-------------------------------------------------------------------------- +# | +# | Let's download php.ini for prod and development +# | + +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* +ENV TEMPLATE_PHP_INI=development + +# |-------------------------------------------------------------------------- +# | Composer +# |-------------------------------------------------------------------------- +# | +# | Installs Composer to easily manage your PHP dependencies. +# | + +#ENV COMPOSER_ALLOW_SUPERUSER 1 + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=real_composer &&\ + chmod +x /usr/local/bin/real_composer + +# TODO: utils.php in /usr/local/bin... bof! +COPY utils/utils.php /usr/local/bin/utils.php +COPY utils/composer_proxy.sh /usr/local/bin/composer +COPY utils/generate_conf.php /usr/local/bin/generate_conf.php + + +# |-------------------------------------------------------------------------- +# | prestissimo +# |-------------------------------------------------------------------------- +# | +# | Installs Prestissimo to improve Composer download performance. +# | + +USER docker +RUN composer global require hirak/prestissimo && \ + composer global require bamarni/symfony-console-autocomplete && \ + rm -rf $HOME\.composer + +USER root + + + + + +RUN chown docker:docker /var/www/html + + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./vendor/bin to the PATH (utility function to use Composer bin easily) +# | +ENV PATH="$PATH:./vendor/bin:~/.composer/vendor/bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./vendor/bin:~/.composer/vendor/bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | + +RUN echo 'eval "$(symfony-autocomplete)"' > ~/.bash_profile + +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | NodeJS path registration (if we install NodeJS, this is useful). +# | +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV IMAGE_VARIANT=fpm + +# Add Tini (to be able to stop the container with ctrl-c. +# See: https://github.com/krallin/tini +ENV TINI_VERSION v0.16.1 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + +COPY utils/generate_cron.php /usr/local/bin/generate_cron.php +COPY utils/startup_commands.php /usr/local/bin/startup_commands.php + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + + + +CMD ["php-fpm"] + + +USER docker + +COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php + +ONBUILD ARG PHP_EXTENSIONS +ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +ONBUILD ARG INSTALL_CRON +ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \ + SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \ + && SUPERCRONIC=supercronic-linux-amd64 \ + && SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ + && chmod +x "$SUPERCRONIC" \ + && sudo mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && sudo ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic; \ + fi; + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. The later will allow you to easily manage +# | your frontend dependencies. +# | Also installs yarn. It provides some nice improvements over npm. +# | +ONBUILD ARG NODE_VERSION +ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo bash - && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends yarn; \ + fi; diff --git a/Dockerfile.7.3.apache b/Dockerfile.7.3.apache new file mode 100644 index 00000000..0fd28542 --- /dev/null +++ b/Dockerfile.7.3.apache @@ -0,0 +1,30 @@ +ARG INSTALL_CRON=1 +ARG INSTALL_COMPOSER=1 +FROM thecodingmachine/php:7.3-v2-slim-apache + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +USER root +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all.sh && ./disable_all.sh +USER docker + +# |-------------------------------------------------------------------------- +# | Default PHP extensions to be enabled +# |-------------------------------------------------------------------------- +ENV PHP_EXTENSION_APCU=1 \ + PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ + PHP_EXTENSION_PDO_MYSQL=1 \ + PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ + PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.7.3.apache.node10 b/Dockerfile.7.3.apache.node10 new file mode 100644 index 00000000..720da69f --- /dev/null +++ b/Dockerfile.7.3.apache.node10 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-apache + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.3.apache.node12 b/Dockerfile.7.3.apache.node12 new file mode 100644 index 00000000..6ed4e946 --- /dev/null +++ b/Dockerfile.7.3.apache.node12 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-apache + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.3.apache.node8 b/Dockerfile.7.3.apache.node8 new file mode 100644 index 00000000..fe00e3b2 --- /dev/null +++ b/Dockerfile.7.3.apache.node8 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-apache + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.3.cli b/Dockerfile.7.3.cli new file mode 100644 index 00000000..0227f265 --- /dev/null +++ b/Dockerfile.7.3.cli @@ -0,0 +1,30 @@ +ARG INSTALL_CRON=1 +ARG INSTALL_COMPOSER=1 +FROM thecodingmachine/php:7.3-v2-slim-cli + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +USER root +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all.sh && ./disable_all.sh +USER docker + +# |-------------------------------------------------------------------------- +# | Default PHP extensions to be enabled +# |-------------------------------------------------------------------------- +ENV PHP_EXTENSION_APCU=1 \ + PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ + PHP_EXTENSION_PDO_MYSQL=1 \ + PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ + PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.7.3.cli.node10 b/Dockerfile.7.3.cli.node10 new file mode 100644 index 00000000..9073c49e --- /dev/null +++ b/Dockerfile.7.3.cli.node10 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-cli + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.3.cli.node12 b/Dockerfile.7.3.cli.node12 new file mode 100644 index 00000000..2896e258 --- /dev/null +++ b/Dockerfile.7.3.cli.node12 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-cli + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.3.cli.node8 b/Dockerfile.7.3.cli.node8 new file mode 100644 index 00000000..0d43b561 --- /dev/null +++ b/Dockerfile.7.3.cli.node8 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-cli + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.3.fpm b/Dockerfile.7.3.fpm new file mode 100644 index 00000000..79316609 --- /dev/null +++ b/Dockerfile.7.3.fpm @@ -0,0 +1,30 @@ +ARG INSTALL_CRON=1 +ARG INSTALL_COMPOSER=1 +FROM thecodingmachine/php:7.3-v2-slim-fpm + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +USER root +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all.sh && ./disable_all.sh +USER docker + +# |-------------------------------------------------------------------------- +# | Default PHP extensions to be enabled +# |-------------------------------------------------------------------------- +ENV PHP_EXTENSION_APCU=1 \ + PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ + PHP_EXTENSION_PDO_MYSQL=1 \ + PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ + PHP_EXTENSION_SOAP=1 + diff --git a/Dockerfile.7.3.fpm.node10 b/Dockerfile.7.3.fpm.node10 new file mode 100644 index 00000000..14571f1d --- /dev/null +++ b/Dockerfile.7.3.fpm.node10 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-fpm + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.3.fpm.node12 b/Dockerfile.7.3.fpm.node12 new file mode 100644 index 00000000..75a17e4b --- /dev/null +++ b/Dockerfile.7.3.fpm.node12 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-fpm + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_12.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.7.3.fpm.node8 b/Dockerfile.7.3.fpm.node8 new file mode 100644 index 00000000..a930980e --- /dev/null +++ b/Dockerfile.7.3.fpm.node8 @@ -0,0 +1,18 @@ +FROM thecodingmachine/php:7.3-v2-fpm + +LABEL authors="Julien Neuhart , David Négrier " + +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_8.x | bash - && \ + apt-get update && \ + apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ + apt-get update && \ + apt-get install -y --no-install-recommends yarn && \ + npm install -g npm + +USER docker diff --git a/Dockerfile.slim.fpm b/Dockerfile.7.3.slim.apache similarity index 66% rename from Dockerfile.slim.fpm rename to Dockerfile.7.3.slim.apache index 68f59a07..50e91d65 100644 --- a/Dockerfile.slim.fpm +++ b/Dockerfile.7.3.slim.apache @@ -1,15 +1,7 @@ -FROM ubuntu:bionic +FROM php:7.3-apache-stretch LABEL authors="Julien Neuhart , David Négrier " -# Fixes some weird terminal issues such as broken clear / CTRL+L -#ENV TERM=linux - -# Ensure apt doesn't ask questions when installing stuff -ENV DEBIAN_FRONTEND=noninteractive - -ARG PHP_VERSION -ENV PHP_VERSION=$PHP_VERSION # |-------------------------------------------------------------------------- # | Main PHP extensions @@ -18,32 +10,13 @@ ENV PHP_VERSION=$PHP_VERSION # | Installs the main PHP extensions # | -# Install php an other packages -RUN apt-get update \ - && apt-get install -y --no-install-recommends gnupg \ - && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - git \ - nano \ - sudo \ - iproute2 \ - openssh-client \ - procps \ - unzip \ - ca-certificates \ - curl \ - php${PHP_VERSION}-cli \ - php${PHP_VERSION}-curl \ - php${PHP_VERSION}-json \ - php${PHP_VERSION}-mbstring \ - php${PHP_VERSION}-opcache \ - php${PHP_VERSION}-readline \ - php${PHP_VERSION}-xml \ - php${PHP_VERSION}-zip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.3 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini # |-------------------------------------------------------------------------- # | User @@ -63,16 +36,11 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # | Let's download php.ini for prod and development # | -#ADD https://raw.githubusercontent.com/php/php-src/PHP-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production -#ADD https://raw.githubusercontent.com/php/php-src/PHP-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development -#RUN chmod 644 /usr/local/etc/php/php.ini-* - +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* ENV TEMPLATE_PHP_INI=development -# Let's remove the default php.ini file (it will be copied from TEMPLATE_PHP_INI) -RUN rm /etc/php/${PHP_VERSION}/cli/php.ini - - # |-------------------------------------------------------------------------- # | Composer # |-------------------------------------------------------------------------- @@ -89,41 +57,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local COPY utils/utils.php /usr/local/bin/utils.php COPY utils/composer_proxy.sh /usr/local/bin/composer COPY utils/generate_conf.php /usr/local/bin/generate_conf.php -COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php -# |-------------------------------------------------------------------------- -# | Default PHP extensions to be enabled -# | By default, enable all the extensions that are enabled on a base Ubuntu install -# |-------------------------------------------------------------------------- -ENV PHP_EXTENSION_CALENDAR=1 \ - PHP_EXTENSION_CTYPE=1 \ - PHP_EXTENSION_CURL=1 \ - PHP_EXTENSION_DOM=1 \ - PHP_EXTENSION_EXIF=1 \ - PHP_EXTENSION_FILEINFO=1 \ - PHP_EXTENSION_FTP=1 \ - PHP_EXTENSION_GETTEXT=1 \ - PHP_EXTENSION_ICONV=1 \ - PHP_EXTENSION_JSON=1 \ - PHP_EXTENSION_MBSTRING=1 \ - PHP_EXTENSION_OPCACHE=1 \ - PHP_EXTENSION_PDO=1 \ - PHP_EXTENSION_PHAR=1 \ - PHP_EXTENSION_POSIX=1 \ - PHP_EXTENSION_READLINE=1 \ - PHP_EXTENSION_SHMOP=1 \ - PHP_EXTENSION_SIMPLEXML=1 \ - PHP_EXTENSION_SOCKETS=1 \ - PHP_EXTENSION_SYSVMSG=1 \ - PHP_EXTENSION_SYSVSEM=1 \ - PHP_EXTENSION_SYSVSHM=1 \ - PHP_EXTENSION_TOKENIZER=1 \ - PHP_EXTENSION_WDDX=1 \ - PHP_EXTENSION_XML=1 \ - PHP_EXTENSION_XMLREADER=1 \ - PHP_EXTENSION_XMLWRITER=1 \ - PHP_EXTENSION_XSL=1 \ - PHP_EXTENSION_ZIP=1 # |-------------------------------------------------------------------------- # | prestissimo @@ -135,27 +69,29 @@ ENV PHP_EXTENSION_CALENDAR=1 \ USER docker RUN composer global require hirak/prestissimo && \ composer global require bamarni/symfony-console-autocomplete && \ - rm -rf ~/.composer + rm -rf $HOME\.composer USER root +ENV APACHE_DOCUMENT_ROOT / +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf -RUN apt-get update \ - && apt-get install -y --no-install-recommends php${PHP_VERSION}-fpm \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* - - +# |-------------------------------------------------------------------------- +# | Apache mod_rewrite +# |-------------------------------------------------------------------------- +# | +# | Enables Apache mod_rewrite. +# | +RUN a2enmod rewrite -RUN mkdir -p /var/www/html && chown -R docker: /var/www RUN chown docker:docker /var/www/html -WORKDIR /var/www/html # |-------------------------------------------------------------------------- @@ -213,9 +149,9 @@ RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/ # | Defines the entrypoint. # | -ENV IMAGE_VARIANT=fpm +ENV IMAGE_VARIANT=apache -# Add Tini (to be able to stop the container with ctrl-c). +# Add Tini (to be able to stop the container with ctrl-c. # See: https://github.com/krallin/tini ENV TINI_VERSION v0.16.1 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini @@ -224,30 +160,43 @@ RUN chmod +x /tini COPY utils/generate_cron.php /usr/local/bin/generate_cron.php COPY utils/startup_commands.php /usr/local/bin/startup_commands.php +COPY utils/enable_apache_mods.php /usr/local/bin/enable_apache_mods.php +COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh + COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh -COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions -RUN ln -s ${PHP_VERSION} /usr/local/lib/thecodingmachine-php/extensions/current - ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] +# Let's register a servername to remove the message "apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.2. Set the 'ServerName' directive globally to suppress this message" +RUN echo "ServerName localhost" > /etc/apache2/conf-available/servername.conf +RUN a2enconf servername + +CMD ["apache2-foreground"] + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines Apache user. Bu default, we switch this to "docker" user. +# | This way, no problem to write from Apache in the current working directory. +# | Important! This should be changed back to www-data in production. +# | +ENV APACHE_RUN_USER=docker \ + APACHE_RUN_GROUP=docker -CMD ["php-fpm"] -RUN touch /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini && ln -s /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini /etc/php/${PHP_VERSION}/cli/conf.d/generated_conf.ini USER docker COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php -COPY utils/install_selected_extensions.sh /usr/local/bin/install_selected_extensions.sh ONBUILD ARG PHP_EXTENSIONS ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" -ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_selected_extensions.sh +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php # |-------------------------------------------------------------------------- # | Supercronic diff --git a/Dockerfile.7.3.slim.cli b/Dockerfile.7.3.slim.cli new file mode 100644 index 00000000..30b8fa52 --- /dev/null +++ b/Dockerfile.7.3.slim.cli @@ -0,0 +1,208 @@ +FROM php:7.3-cli-stretch + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.3 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini + +# |-------------------------------------------------------------------------- +# | User +# |-------------------------------------------------------------------------- +# | +# | Define a default user with sudo rights. +# | + +RUN useradd -ms /bin/bash docker && adduser docker sudo +# Users in the sudoers group can sudo as root without password. +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Default php.ini file +# |-------------------------------------------------------------------------- +# | +# | Let's download php.ini for prod and development +# | + +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* +ENV TEMPLATE_PHP_INI=development + +# |-------------------------------------------------------------------------- +# | Composer +# |-------------------------------------------------------------------------- +# | +# | Installs Composer to easily manage your PHP dependencies. +# | + +#ENV COMPOSER_ALLOW_SUPERUSER 1 + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=real_composer &&\ + chmod +x /usr/local/bin/real_composer + +# TODO: utils.php in /usr/local/bin... bof! +COPY utils/utils.php /usr/local/bin/utils.php +COPY utils/composer_proxy.sh /usr/local/bin/composer +COPY utils/generate_conf.php /usr/local/bin/generate_conf.php + + +# |-------------------------------------------------------------------------- +# | prestissimo +# |-------------------------------------------------------------------------- +# | +# | Installs Prestissimo to improve Composer download performance. +# | + +USER docker +RUN composer global require hirak/prestissimo && \ + composer global require bamarni/symfony-console-autocomplete && \ + rm -rf $HOME\.composer + +USER root + + + + +RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app +WORKDIR /usr/src/app + + + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./vendor/bin to the PATH (utility function to use Composer bin easily) +# | +ENV PATH="$PATH:./vendor/bin:~/.composer/vendor/bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./vendor/bin:~/.composer/vendor/bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | + +RUN echo 'eval "$(symfony-autocomplete)"' > ~/.bash_profile + +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | NodeJS path registration (if we install NodeJS, this is useful). +# | +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV IMAGE_VARIANT=cli + +# Add Tini (to be able to stop the container with ctrl-c. +# See: https://github.com/krallin/tini +ENV TINI_VERSION v0.16.1 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + +COPY utils/generate_cron.php /usr/local/bin/generate_cron.php +COPY utils/startup_commands.php /usr/local/bin/startup_commands.php + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + + +CMD ["php", "-v"] + + + +USER docker + +COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php + +ONBUILD ARG PHP_EXTENSIONS +ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +ONBUILD ARG INSTALL_CRON +ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \ + SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \ + && SUPERCRONIC=supercronic-linux-amd64 \ + && SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ + && chmod +x "$SUPERCRONIC" \ + && sudo mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && sudo ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic; \ + fi; + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. The later will allow you to easily manage +# | your frontend dependencies. +# | Also installs yarn. It provides some nice improvements over npm. +# | +ONBUILD ARG NODE_VERSION +ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo bash - && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends yarn; \ + fi; diff --git a/Dockerfile.7.3.slim.fpm b/Dockerfile.7.3.slim.fpm new file mode 100644 index 00000000..2b1c2d0e --- /dev/null +++ b/Dockerfile.7.3.slim.fpm @@ -0,0 +1,207 @@ +FROM php:7.3-fpm-stretch + +LABEL authors="Julien Neuhart , David Négrier " + + +# |-------------------------------------------------------------------------- +# | Main PHP extensions +# |-------------------------------------------------------------------------- +# | +# | Installs the main PHP extensions +# | + +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s 7.3 /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini + +# |-------------------------------------------------------------------------- +# | User +# |-------------------------------------------------------------------------- +# | +# | Define a default user with sudo rights. +# | + +RUN useradd -ms /bin/bash docker && adduser docker sudo +# Users in the sudoers group can sudo as root without password. +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Default php.ini file +# |-------------------------------------------------------------------------- +# | +# | Let's download php.ini for prod and development +# | + +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* +ENV TEMPLATE_PHP_INI=development + +# |-------------------------------------------------------------------------- +# | Composer +# |-------------------------------------------------------------------------- +# | +# | Installs Composer to easily manage your PHP dependencies. +# | + +#ENV COMPOSER_ALLOW_SUPERUSER 1 + +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=real_composer &&\ + chmod +x /usr/local/bin/real_composer + +# TODO: utils.php in /usr/local/bin... bof! +COPY utils/utils.php /usr/local/bin/utils.php +COPY utils/composer_proxy.sh /usr/local/bin/composer +COPY utils/generate_conf.php /usr/local/bin/generate_conf.php + + +# |-------------------------------------------------------------------------- +# | prestissimo +# |-------------------------------------------------------------------------- +# | +# | Installs Prestissimo to improve Composer download performance. +# | + +USER docker +RUN composer global require hirak/prestissimo && \ + composer global require bamarni/symfony-console-autocomplete && \ + rm -rf $HOME\.composer + +USER root + + + + + +RUN chown docker:docker /var/www/html + + +# |-------------------------------------------------------------------------- +# | PATH updating +# |-------------------------------------------------------------------------- +# | +# | Let's add ./vendor/bin to the PATH (utility function to use Composer bin easily) +# | +ENV PATH="$PATH:./vendor/bin:~/.composer/vendor/bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./vendor/bin:~/.composer/vendor/bin#g' /etc/sudoers + +USER docker +# |-------------------------------------------------------------------------- +# | SSH client +# |-------------------------------------------------------------------------- +# | +# | Let's set-up the SSH client (for connections to private git repositories) +# | We create an empty known_host file and we launch the ssh-agent +# | + +RUN mkdir ~/.ssh && touch ~/.ssh/known_hosts && chmod 644 ~/.ssh/known_hosts && eval $(ssh-agent -s) + + +# |-------------------------------------------------------------------------- +# | .bashrc updating +# |-------------------------------------------------------------------------- +# | +# | Let's update the .bashrc to add nice aliases +# | + +RUN echo 'eval "$(symfony-autocomplete)"' > ~/.bash_profile + +RUN { \ + echo "alias ls='ls --color=auto'"; \ + echo "alias ll='ls --color=auto -alF'"; \ + echo "alias la='ls --color=auto -A'"; \ + echo "alias l='ls --color=auto -CF'"; \ + } >> ~/.bashrc + +USER root + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | NodeJS path registration (if we install NodeJS, this is useful). +# | +ENV PATH="$PATH:./node_modules/.bin" +RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:./node_modules/.bin#g' /etc/sudoers + +# |-------------------------------------------------------------------------- +# | Entrypoint +# |-------------------------------------------------------------------------- +# | +# | Defines the entrypoint. +# | + +ENV IMAGE_VARIANT=fpm + +# Add Tini (to be able to stop the container with ctrl-c. +# See: https://github.com/krallin/tini +ENV TINI_VERSION v0.16.1 +ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini +RUN chmod +x /tini + +COPY utils/generate_cron.php /usr/local/bin/generate_cron.php +COPY utils/startup_commands.php /usr/local/bin/startup_commands.php + +COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh + +ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] + + + + +CMD ["php-fpm"] + + +USER docker + +COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php + +ONBUILD ARG PHP_EXTENSIONS +ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php + +# |-------------------------------------------------------------------------- +# | Supercronic +# |-------------------------------------------------------------------------- +# | +# | Supercronic is a drop-in replacement for cron (for containers). +# | + +ONBUILD ARG INSTALL_CRON +ONBUILD RUN if [ -n "$INSTALL_CRON" ]; then \ + SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.5/supercronic-linux-amd64 \ + && SUPERCRONIC=supercronic-linux-amd64 \ + && SUPERCRONIC_SHA1SUM=9aeb41e00cc7b71d30d33c57a2333f2c2581a201 \ + && curl -fsSLO "$SUPERCRONIC_URL" \ + && echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ + && chmod +x "$SUPERCRONIC" \ + && sudo mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ + && sudo ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic; \ + fi; + + +# |-------------------------------------------------------------------------- +# | NodeJS +# |-------------------------------------------------------------------------- +# | +# | Installs NodeJS and npm. The later will allow you to easily manage +# | your frontend dependencies. +# | Also installs yarn. It provides some nice improvements over npm. +# | +ONBUILD ARG NODE_VERSION +ONBUILD RUN if [ -n "$NODE_VERSION" ]; then \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends gnupg && \ + curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | sudo bash - && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends nodejs && \ + curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - && \ + echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list && \ + sudo apt-get update && \ + sudo apt-get install -y --no-install-recommends yarn; \ + fi; diff --git a/README.md b/README.md index 39bbcb30..b309804a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/thecodingmachine/docker-images-php.svg?branch=v3)](https://travis-ci.org/thecodingmachine/docker-images-php) +[![Build Status](https://travis-ci.org/thecodingmachine/docker-images-php.svg?branch=v2)](https://travis-ci.org/thecodingmachine/docker-images-php) # General purpose PHP images for Docker @@ -20,66 +20,51 @@ This repository contains a set of developer-friendly, general purpose PHP images | Name | PHP version | type |variant | NodeJS version | Size |-------------------------------------------------------------------------|------------------------------|------|--------|-----------------|------ -| [thecodingmachine/php:7.4-v3-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.apache) | `7.4.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-apache) -| [thecodingmachine/php:7.4-v3-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.apache.node8) | `7.4.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-apache-node8) -| [thecodingmachine/php:7.4-v3-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.apache.node10) | `7.4.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-apache-node10) -| [thecodingmachine/php:7.4-v3-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.apache.node12) | `7.4.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-apache-node12) -| [thecodingmachine/php:7.4-v3-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.fpm) | `7.4.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-fpm) -| [thecodingmachine/php:7.4-v3-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.fpm.node8) | `7.4.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-fpm-node8) -| [thecodingmachine/php:7.4-v3-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.fpm.node10) | `7.4.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-fpm-node10) -| [thecodingmachine/php:7.4-v3-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.fpm.node12) | `7.4.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-fpm-node12) -| [thecodingmachine/php:7.4-v3-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.cli) | `7.4.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-cli) -| [thecodingmachine/php:7.4-v3-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.cli.node8) | `7.4.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-cli-node8) -| [thecodingmachine/php:7.4-v3-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.cli.node10) | `7.4.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-cli-node10) -| [thecodingmachine/php:7.4-v3-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.cli.node12) | `7.4.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-cli-node12) -| [thecodingmachine/php:7.4-v3-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.slim.apache) | `7.4.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-slim-apache) -| [thecodingmachine/php:7.4-v3-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.slim.fpm) | `7.4.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-slim-fpm) -| [thecodingmachine/php:7.4-v3-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.4.slim.cli) | `7.4.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.4-v3-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.4-v3-slim-cli) -| [thecodingmachine/php:7.3-v3-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.apache) | `7.3.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-apache) -| [thecodingmachine/php:7.3-v3-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.apache.node8) | `7.3.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-apache-node8) -| [thecodingmachine/php:7.3-v3-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.apache.node10) | `7.3.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-apache-node10) -| [thecodingmachine/php:7.3-v3-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.apache.node12) | `7.3.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-apache-node12) -| [thecodingmachine/php:7.3-v3-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.fpm) | `7.3.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-fpm) -| [thecodingmachine/php:7.3-v3-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.fpm.node8) | `7.3.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-fpm-node8) -| [thecodingmachine/php:7.3-v3-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.fpm.node10) | `7.3.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-fpm-node10) -| [thecodingmachine/php:7.3-v3-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.fpm.node12) | `7.3.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-fpm-node12) -| [thecodingmachine/php:7.3-v3-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.cli) | `7.3.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-cli) -| [thecodingmachine/php:7.3-v3-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.cli.node8) | `7.3.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-cli-node8) -| [thecodingmachine/php:7.3-v3-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.cli.node10) | `7.3.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-cli-node10) -| [thecodingmachine/php:7.3-v3-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.cli.node12) | `7.3.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-cli-node12) -| [thecodingmachine/php:7.3-v3-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.slim.apache) | `7.3.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-slim-apache) -| [thecodingmachine/php:7.3-v3-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.slim.fpm) | `7.3.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-slim-fpm) -| [thecodingmachine/php:7.3-v3-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.3.slim.cli) | `7.3.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v3-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v3-slim-cli) -| [thecodingmachine/php:7.2-v3-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.apache) | `7.2.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-apache) -| [thecodingmachine/php:7.2-v3-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.apache.node8) | `7.2.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-apache-node8) -| [thecodingmachine/php:7.2-v3-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.apache.node10) | `7.2.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-apache-node10) -| [thecodingmachine/php:7.2-v3-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.apache.node12) | `7.2.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-apache-node12) -| [thecodingmachine/php:7.2-v3-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.fpm) | `7.2.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-fpm) -| [thecodingmachine/php:7.2-v3-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.fpm.node8) | `7.2.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-fpm-node8) -| [thecodingmachine/php:7.2-v3-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.fpm.node10) | `7.2.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-fpm-node10) -| [thecodingmachine/php:7.2-v3-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.fpm.node12) | `7.2.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-fpm-node12) -| [thecodingmachine/php:7.2-v3-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.cli) | `7.2.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-cli) -| [thecodingmachine/php:7.2-v3-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.cli.node8) | `7.2.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-cli-node8) -| [thecodingmachine/php:7.2-v3-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.cli.node10) | `7.2.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-cli-node10) -| [thecodingmachine/php:7.2-v3-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.cli.node12) | `7.2.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-cli-node12) -| [thecodingmachine/php:7.2-v3-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.slim.apache) | `7.2.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-slim-apache) -| [thecodingmachine/php:7.2-v3-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.slim.fpm) | `7.2.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-slim-fpm) -| [thecodingmachine/php:7.2-v3-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.2.slim.cli) | `7.2.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v3-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v3-slim-cli) -| [thecodingmachine/php:7.1-v3-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.apache) | `7.1.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-apache) -| [thecodingmachine/php:7.1-v3-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.apache.node8) | `7.1.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-apache-node8) -| [thecodingmachine/php:7.1-v3-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.apache.node10) | `7.1.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-apache-node10) -| [thecodingmachine/php:7.1-v3-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.apache.node12) | `7.1.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-apache-node12) -| [thecodingmachine/php:7.1-v3-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.fpm) | `7.1.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-fpm) -| [thecodingmachine/php:7.1-v3-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.fpm.node8) | `7.1.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-fpm-node8) -| [thecodingmachine/php:7.1-v3-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.fpm.node10) | `7.1.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-fpm-node10) -| [thecodingmachine/php:7.1-v3-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.fpm.node12) | `7.1.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-fpm-node12) -| [thecodingmachine/php:7.1-v3-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.cli) | `7.1.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-cli) -| [thecodingmachine/php:7.1-v3-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.cli.node8) | `7.1.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-cli-node8) -| [thecodingmachine/php:7.1-v3-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.cli.node10) | `7.1.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-cli-node10) -| [thecodingmachine/php:7.1-v3-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.cli.node12) | `7.1.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-cli-node12) -| [thecodingmachine/php:7.1-v3-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.slim.apache) | `7.1.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-slim-apache) -| [thecodingmachine/php:7.1-v3-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.slim.fpm) | `7.1.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-slim-fpm) -| [thecodingmachine/php:7.1-v3-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.7.1.slim.cli) | `7.1.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v3-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v3-slim-cli) +| [thecodingmachine/php:7.3-v2-apache](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.apache) | `7.3.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-apache) +| [thecodingmachine/php:7.3-v2-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.apache.node8) | `7.3.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-apache-node8) +| [thecodingmachine/php:7.3-v2-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.apache.node10) | `7.3.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-apache-node10) +| [thecodingmachine/php:7.3-v2-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.apache.node12) | `7.3.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-apache-node12) +| [thecodingmachine/php:7.3-v2-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.fpm) | `7.3.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-fpm) +| [thecodingmachine/php:7.3-v2-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.fpm.node8) | `7.3.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-fpm-node8) +| [thecodingmachine/php:7.3-v2-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.fpm.node10) | `7.3.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-fpm-node10) +| [thecodingmachine/php:7.3-v2-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.fpm.node12) | `7.3.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-fpm-node12) +| [thecodingmachine/php:7.3-v2-cli](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.cli) | `7.3.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-cli) +| [thecodingmachine/php:7.3-v2-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.cli.node8) | `7.3.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-cli-node8) +| [thecodingmachine/php:7.3-v2-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.cli.node10) | `7.3.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-cli-node10) +| [thecodingmachine/php:7.3-v2-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.cli.node12) | `7.3.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-cli-node12) +| [thecodingmachine/php:7.3-v2-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.slim.apache) | `7.3.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-slim-apache) +| [thecodingmachine/php:7.3-v2-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.slim.fpm) | `7.3.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-slim-fpm) +| [thecodingmachine/php:7.3-v2-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.3.slim.cli) | `7.3.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.3-v2-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.3-v2-slim-cli) +| [thecodingmachine/php:7.2-v2-apache](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.apache) | `7.2.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-apache) +| [thecodingmachine/php:7.2-v2-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.apache.node8) | `7.2.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-apache-node8) +| [thecodingmachine/php:7.2-v2-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.apache.node10) | `7.2.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-apache-node10) +| [thecodingmachine/php:7.2-v2-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.apache.node12) | `7.2.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-apache-node12) +| [thecodingmachine/php:7.2-v2-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.fpm) | `7.2.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-fpm) +| [thecodingmachine/php:7.2-v2-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.fpm.node8) | `7.2.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-fpm-node8) +| [thecodingmachine/php:7.2-v2-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.fpm.node10) | `7.2.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-fpm-node10) +| [thecodingmachine/php:7.2-v2-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.fpm.node12) | `7.2.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-fpm-node12) +| [thecodingmachine/php:7.2-v2-cli](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.cli) | `7.2.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-cli) +| [thecodingmachine/php:7.2-v2-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.cli.node8) | `7.2.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-cli-node8) +| [thecodingmachine/php:7.2-v2-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.cli.node10) | `7.2.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-cli-node10) +| [thecodingmachine/php:7.2-v2-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.cli.node12) | `7.2.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-cli-node12) +| [thecodingmachine/php:7.2-v2-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.slim.apache) | `7.2.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-slim-apache) +| [thecodingmachine/php:7.2-v2-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.slim.fpm) | `7.2.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-slim-fpm) +| [thecodingmachine/php:7.2-v2-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.2.slim.cli) | `7.2.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.2-v2-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.2-v2-slim-cli) +| [thecodingmachine/php:7.1-v2-apache](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.apache) | `7.1.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-apache) +| [thecodingmachine/php:7.1-v2-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.apache.node8) | `7.1.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-apache-node8) +| [thecodingmachine/php:7.1-v2-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.apache.node10) | `7.1.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-apache-node10) +| [thecodingmachine/php:7.1-v2-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.apache.node12) | `7.1.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-apache-node12) +| [thecodingmachine/php:7.1-v2-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.fpm) | `7.1.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-fpm) +| [thecodingmachine/php:7.1-v2-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.fpm.node8) | `7.1.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-fpm-node8) +| [thecodingmachine/php:7.1-v2-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.fpm.node10) | `7.1.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-fpm-node10) +| [thecodingmachine/php:7.1-v2-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.fpm.node12) | `7.1.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-fpm-node12) +| [thecodingmachine/php:7.1-v2-cli](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.cli) | `7.1.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-cli) +| [thecodingmachine/php:7.1-v2-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.cli.node8) | `7.1.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-cli-node8) +| [thecodingmachine/php:7.1-v2-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.cli.node10) | `7.1.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-cli-node10) +| [thecodingmachine/php:7.1-v2-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.cli.node12) | `7.1.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-cli-node12) +| [thecodingmachine/php:7.1-v2-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.slim.apache) | `7.1.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-slim-apache) +| [thecodingmachine/php:7.1-v2-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.slim.fpm) | `7.1.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-slim-fpm) +| [thecodingmachine/php:7.1-v2-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.7.1.slim.cli) | `7.1.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:7.1-v2-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:7.1-v2-slim-cli) Note: we do not tag patch releases of PHP, only minor versions. You will find one image for PHP 7.1, one for PHP 7.2, @@ -88,7 +73,7 @@ When 7.1.13 is out, you certainly want to upgrade automatically to this patch re Images are automatically updated when a new patch version of PHP is released, so the PHP 7.1 image will always contain the most up-to-date version of the PHP 7.1.x branch. If you want to automatically update your images on your production -environment, you can use tools like [watchtower](https://github.com/v3tec/watchtower) that will monitor new versions of +environment, you can use tools like [watchtower](https://github.com/v2tec/watchtower) that will monitor new versions of the images and update your environment on the fly. ## Usage @@ -98,26 +83,26 @@ These images are based on the [official PHP image](https://hub.docker.com/_/php/ Example with CLI: ```bash -$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app thecodingmachine/php:7.4-v3-cli php your-script.php +$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app thecodingmachine/php:7.2-v2-cli php your-script.php ``` Example with Apache: ```bash -$ docker run -p 80:80 --rm --name my-apache-php-app -v "$PWD":/var/www/html thecodingmachine/php:7.4-v3-apache +$ docker run -p 80:80 --rm --name my-apache-php-app -v "$PWD":/var/www/html thecodingmachine/php:7.2-v2-apache ``` Example with PHP-FPM: ```bash -$ docker run -p 9000:9000 --rm --name my-php-fpm -v "$PWD":/var/www/html thecodingmachine/7.4-v3-fpm +$ docker run -p 9000:9000 --rm --name my-php-fpm -v "$PWD":/var/www/html thecodingmachine/7.2-v2-fpm ``` Example with Apache + Node 8.x in a Dockerfile: **Dockerfile** ```Dockerfile -FROM thecodingmachine/php:7.4-v3-apache-node8 +FROM thecodingmachine/php:7.2-v2-apache-node8 COPY src/ /var/www/html/ RUN composer install @@ -129,28 +114,29 @@ RUN npm run build This image comes with 2 "types": the *slim* and the **fat** image. -The slim image contains only a set a base PHP extensions. - -Only these extensions are available in the slim image: `calendar ctype curl dom exif fileinfo ftp gettext iconv json mbstring opcache pdo phar posix readline shmop simplexml sockets sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl zip` - -The slim image provides a simple way to install the other extensions. You would typically use the "slim" +The slim image contains no extensions. But it provides a simple way to install them. You would typically use the "slim" image in a `Dockerfile` when building your own custom image. The fat image contains the most commonly used extensions. You would typically use it in a local or CI environment. +### Compiled extensions + +For both types, these extensions are **compiled in PHP** (cannot be disabled): mbstring ftp mysqlnd + ### Fat image Below is a list of extensions available in this image: -**Enabled by default (in addition to extensions enabled in Slim image):** apcu mysqli pdo_mysql igbinary redis soap +**Enabled by default:** apcu mysqli opcache pdo_mysql redis zip soap -**Available (can be enabled using environment variables):** amqp ast bcmath blackfire bz2 calendar dba ds enchant ev event exif mailparse msgpack gd gettext gmp gnupg igbinary imagick imap intl ldap mcrypt memcached mongodb pcntl pcov pdo_dblib pdo_pgsql pgsql pspell shmop snmp sockets swoole tidy weakref(-beta) xdebug xmlrpc xsl yaml +**Available (can be enabled using environment variables):** amqp ast bcmath blackfire bz2 calendar dba ds enchant ev event exif mailparse msgpack gd gettext gmp gnupg igbinary imagick imap intl ldap mcrypt memcached mongodb pcntl pcov pdo_dblib pdo_pgsql pgsql pspell shmop snmp sockets swoole sysvmsg sysvsem sysvshm tidy wddx weakref(-beta) xdebug xmlrpc xsl yaml -**Note**: as of 2019-11-28, PHP 7.4 has just been released and some extensions are not yet ready: +**Note**: as of 2018-12-13, PHP 7.3 has just been released and some extensions are not yet ready: -- *blackfire* extension is not compatible with PHP 7.4 yet -- *mcrypt* is not available anymore in PHP 7.3+ -- *weakref* is not compatible with PHP 7.3+ (but weak references were added to the PHP core in PHP 7.4) +- *amqp* extension is not compatible with PHP 7.3 yet +- *mcrypt* is not available anymore in PHP 7.3 +- *weakref* is not compatible with PHP 7.3 ([there might not be a version for PHP 7.3](https://wiki.php.net/rfc/weakrefs)) +- *xdebug* is provided in version 2.7.0beta1 ### Enabling/disabling extensions in the fat image @@ -162,7 +148,7 @@ For instance: version: '3' services: my_app: - image: thecodingmachine/php:7.4-v3-apache-node8 + image: thecodingmachine/php:7.2-v2-apache-node8 environment: # Enable the PostgreSQL extension PHP_EXTENSION_PGSQL: 1 @@ -173,7 +159,7 @@ services: As an alternative, you can use the `PHP_EXTENSIONS` global variable: ``` -PHP_EXTENSIONS=pgsql gettext imap +PHP_EXTENSIONS=pgsql gettext imap sockets ``` ### Compiling extensions in the slim image @@ -181,8 +167,8 @@ PHP_EXTENSIONS=pgsql gettext imap If you are using the slim image, you can automatically compile the extensions using the `PHP_EXTENSIONS` ARG in your Dockerfile. ```Dockerfile -ARG PHP_EXTENSIONS="apcu mysqli pdo_mysql redis soap" -FROM thecodingmachine/php:7.4-v3-slim-apache +ARG PHP_EXTENSIONS="apcu mysqli opcache pdo_mysql redis zip soap" +FROM thecodingmachine/php:7.2-v2-slim-apache # The build will automatically trigger the download and compilation # of the extensions (thanks to a ONBUILD hook in the slim image) ``` @@ -199,7 +185,7 @@ first FROM): # The PHP_EXTENSIONS ARG will apply to the "slim" image ARG PHP_EXTENSIONS="apcu mysqli opcache pdo_mysql zip soap" -FROM thecodingmachine/php:7.2-v3-apache-node10 AS builder +FROM thecodingmachine/php:7.2-v2-apache-node10 AS builder COPY --chown=docker:docker sources/web . RUN composer install &&\ @@ -207,10 +193,10 @@ RUN composer install &&\ yarn build # The slim image will automatically build the extensions from the list provided at the very top of the file. -FROM thecodingmachine/php:7.2-v3-slim-apache +FROM thecodingmachine/php:7.2-v2-slim-apache ENV APP_ENV=prod \ - APACHE_DOCUMENT_ROOT=public/ + APACHE_DOCUMENT_ROOT=/public COPY --from=builder /var/www/html . ``` @@ -220,7 +206,7 @@ not contain Node, and contains only required extensions. ## Setting parameters in php.ini -By default, the base `php.ini` file used is the [*development* php.ini](https://github.com/php/php-src/blob/PHP-7.4/php.ini-development) file that comes with PHP. +By default, the base `php.ini` file used is the [*development* php.ini](https://github.com/php/php-src/blob/PHP-7.2/php.ini-development) file that comes with PHP. You can use the production `php.ini` file using the `TEMPLATE_PHP_INI` environment variable: @@ -235,7 +221,7 @@ You can override parameters in `php.ini` using the PHP_INI_XXX environment varia version: '3' services: my_app: - image: thecodingmachine/php:7.4-v3-apache-node8 + image: thecodingmachine/php:7.2-v2-apache-node8 environment: # set the parameter memory_limit=1g PHP_INI_MEMORY_LIMIT: 1g @@ -278,15 +264,6 @@ For the *apache* variant, you can change the document root of Apache (i.e. your APACHE_DOCUMENT_ROOT=public/ ``` -If the APACHE_DOCUMENT_ROOT starts with a "/", it will be considered an absolute path. -If the APACHE_DOCUMENT_ROOT does not starts with a "/", it will be a path relative to "/var/www/html". - -``` -# These 2 variables are identical -APACHE_DOCUMENT_ROOT=public/ -APACHE_DOCUMENT_ROOT=/var/www/html/public -``` - ## Enabling/disabling Apache extensions You can enable/disable Apache extensions using the `APACHE_EXTENSION_[extension_name]` environment variable. @@ -297,7 +274,7 @@ For instance: version: '3' services: my_app: - image: thecodingmachine/php:7.4-v3-apache-node8 + image: thecodingmachine/php:7.2-v2-apache-node8 environment: # Enable the DAV extension for Apache APACHE_EXTENSION_DAV: 1 @@ -340,7 +317,7 @@ If you use the *slim* images, you can install a NodeJS version with a simple ARG ```Dockerfile ARG NODE_VERSION=10 -FROM thecodingmachine/php:7.4-v3-slim-apache +FROM thecodingmachine/php:7.2-v2-slim-apache # The build will automatically trigger the download of Node 10 # (thanks to a ONBUILD hook in the slim image) ``` @@ -393,7 +370,7 @@ This can be done easily: **Dockerfile** ``` -FROM thecodingmachine/php:7.4-v3-apache +FROM thecodingmachine/php:7.2-v2-apache # ... @@ -437,7 +414,7 @@ a single argument before the "FROM" clause in your Dockerfile: ```Dockerfile ARG INSTALL_CRON=1 -FROM thecodingmachine/php:7.4-v3-slim-apache +FROM thecodingmachine/php:7.2-v2-slim-apache # The build triggers automatically the installation of Cron ``` @@ -475,12 +452,12 @@ If such a file is mounted in the image, it will be executed on container startup ```bash docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp \ - -v $PWD/my-startup-script.sh:/etc/container/startup.sh thecodingmachine/php:7.4-v3-cli php your-script.php + -v $PWD/my-startup-script.sh:/etc/container/startup.sh thecodingmachine/php:7.2-v2-cli php your-script.php ``` ## Using the CLI variant -The CLI images (thecodingmachine/php:7.x-v3-cli) expect a command to be passed in parameter. +The CLI images (thecodingmachine/php:7.x-v2-cli) expect a command to be passed in parameter. You should override the Docker "command". Important! You should not override the Docker "entrypoint". @@ -488,7 +465,7 @@ Important! You should not override the Docker "entrypoint". **Usage in a Dockerfile:** ```Dockerfile -FROM thecodingmachine/php:7.4-v3-cli +FROM thecodingmachine/php:7.2-v2-cli CMD ["php", "myprogram.php", "some_param"] ``` @@ -500,7 +477,7 @@ CMD ["php", "myprogram.php", "some_param"] version: '3' services: my_app: - image: thecodingmachine/php:7.4-v3-cli + image: thecodingmachine/php:7.2-v2-cli command: php myprogram.php some_param ``` @@ -520,7 +497,7 @@ This option is the easiest way to go if you are using the image on a development version: '3' services: my_app: - image: thecodingmachine/php:7.4-v3-apache-node8 + image: thecodingmachine/php:7.2-v2-apache-node8 volumes: - ~/.ssh:/home/docker/.ssh ``` @@ -541,7 +518,7 @@ Now, let's write a Dockerfile. **Dockerfile** ```yml -FROM thecodingmachine/php:7.4-v3-apache +FROM thecodingmachine/php:7.2-v2-apache ARG SSH_PRIVATE_KEY ARG SSH_KNOWN_HOSTS @@ -579,7 +556,7 @@ kind: Pod spec: containers: - name: foobar - image: thecodingmachine/php:7.4-v3-apache + image: thecodingmachine/php:7.2-v2-apache securityContext: allowPrivilegeEscalation: true # never use "false" here. ``` @@ -601,7 +578,7 @@ Your `docker-compose.yml` file will typically look like this: version: '3.3' services: php: - image: thecodingmachine/php:7.4-v3-apache + image: thecodingmachine/php:7.2-v2-apache ports: - "80:80" environment: @@ -627,7 +604,7 @@ If for some reason, the container name is not "blackfire", you can customize the version: '3.3' services: php: - image: thecodingmachine/php:7.4-v3-apache + image: thecodingmachine/php:7.2-v2-apache environment: PHP_EXTENSION_BLACKFIRE: 1 BLACKFIRE_AGENT: myblackfire @@ -658,7 +635,7 @@ This command will generate all the files from the "blueprint" templates. You can then test your changes using the `build-and-test.sh` command: ```bash -PHP_VERSION=7.4 BRANCH=v3 VARIANT=apache ./build-and-test.sh +PHP_VERSION=7.2 BRANCH=v2 VARIANT=apache ./build-and-test.sh ``` ### Adding additional images diff --git a/build-and-test.sh b/build-and-test.sh index 4316fce4..41434eeb 100755 --- a/build-and-test.sh +++ b/build-and-test.sh @@ -6,7 +6,7 @@ set -xe export BRANCH_VARIANT=`echo "$VARIANT" | sed 's/\./-/g'` # Let's build the "slim" image. -docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} --build-arg PHP_VERSION=${PHP_VERSION} --build-arg GLOBAL_VERSION=${BRANCH} -f Dockerfile.slim.${VARIANT} . +docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} -f Dockerfile.${PHP_VERSION}.slim.${VARIANT} . # Post build unit tests @@ -44,10 +44,12 @@ RESULT=`docker run --rm -v $(pwd)/user33:$CONTAINER_CWD thecodingmachine/php:${P RESULT=`docker run --rm -v $(pwd)/user33:$CONTAINER_CWD thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} composer update -vvv` sudo rm -rf user33 -# Let's check that mbstring is enabled by default (they are compiled in PHP) +# Let's check that mbstring, mysqlnd and ftp are enabled by default (they are compiled in PHP) docker run --rm thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -m | grep mbstring +docker run --rm thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -m | grep mysqlnd +docker run --rm thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -m | grep ftp docker run --rm thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -m | grep PDO -#docker run --rm thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -m | grep pdo_sqlite +docker run --rm thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -m | grep pdo_sqlite if [[ $VARIANT == apache* ]]; then # Test if environment variables are passed to PHP @@ -59,23 +61,6 @@ if [[ $VARIANT == apache* ]]; then RESULT=`curl http://localhost:81/tests/test.php` [[ "$RESULT" = "foo" ]] docker stop $DOCKER_CID - - - # Test Apache document root (relative) - DOCKER_CID=`docker run --rm -e MYVAR=foo -p "81:80" -d -v $(pwd):/var/www/html -e APACHE_DOCUMENT_ROOT=tests thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}` - # Let's wait for Apache to start - sleep 5 - RESULT=`curl http://localhost:81/test.php` - [[ "$RESULT" = "foo" ]] - docker stop $DOCKER_CID - - # Test Apache document root (absolute) - DOCKER_CID=`docker run --rm -e MYVAR=foo -p "81:80" -d -v $(pwd):/var/www/foo -e APACHE_DOCUMENT_ROOT=/var/www/foo/tests thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT}` - # Let's wait for Apache to start - sleep 5 - RESULT=`curl http://localhost:81/test.php` - [[ "$RESULT" = "foo" ]] - docker stop $DOCKER_CID fi # Let's check that the access to cron will fail with a message @@ -91,7 +76,7 @@ RESULT=`docker run --rm thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRA RESULT=`docker run --rm -e TEMPLATE_PHP_INI=production thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -i | grep error_reporting` [[ "$RESULT" = "error_reporting => 22527 => 22527" ]] -RESULT=`docker run --rm -v $(pwd)/tests/php.ini:/etc/php/${PHP_VERSION}/cli/php.ini thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -i | grep error_reporting` +RESULT=`docker run --rm -v $(pwd)/tests/php.ini:/usr/local/etc/php/php.ini thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -i | grep error_reporting` [[ "$RESULT" = "error_reporting => 24575 => 24575" ]] RESULT=`docker run --rm -e PHP_INI_ERROR_REPORTING="E_ERROR | E_WARNING" thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} php -i | grep error_reporting` @@ -115,7 +100,7 @@ docker run --rm -v $PWD/tests/startup.sh:/etc/container/startup.sh thecodingmach ################################# # Let's build the "fat" image ################################# -docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT} --build-arg PHP_VERSION=${PHP_VERSION} --build-arg GLOBAL_VERSION=${BRANCH} -f Dockerfile.${VARIANT} . +docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT} -f Dockerfile.${PHP_VERSION}.${VARIANT} . # Let's check that the crons are actually sending logs in the right place RESULT=`docker run --rm -e CRON_SCHEDULE_1="* * * * * * *" -e CRON_COMMAND_1="(>&1 echo "foobar")" thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT} sleep 1 2>&1 | grep -oP 'msg=foobar' | head -n1` @@ -142,14 +127,13 @@ set -e # Let's check that the "xdebug.remote_host" contains a value different from "no value" docker run --rm -e PHP_EXTENSION_XDEBUG=1 thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT} php -i | grep xdebug.remote_host| grep -v "no value" -if [[ "${PHP_VERSION}" != "7.4" ]]; then - # Tests that blackfire + xdebug will output an error - RESULT=`docker run --rm -e PHP_EXTENSION_XDEBUG=1 -e PHP_EXTENSION_BLACKFIRE=1 thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT} php -v 2>&1 | grep 'WARNING: Both Blackfire and Xdebug are enabled. This is not recommended as the PHP engine may not behave as expected. You should strongly consider disabling Xdebug or Blackfire.'` - [[ "$RESULT" = "WARNING: Both Blackfire and Xdebug are enabled. This is not recommended as the PHP engine may not behave as expected. You should strongly consider disabling Xdebug or Blackfire." ]] +# Tests that blackfire + xdebug will output an error +RESULT=`docker run --rm -e PHP_EXTENSION_XDEBUG=1 -e PHP_EXTENSION_BLACKFIRE=1 thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT} php -v 2>&1 | grep 'WARNING: Both Blackfire and Xdebug are enabled. This is not recommended as the PHP engine may not behave as expected. You should strongly consider disabling Xdebug or Blackfire.'` +[[ "$RESULT" = "WARNING: Both Blackfire and Xdebug are enabled. This is not recommended as the PHP engine may not behave as expected. You should strongly consider disabling Xdebug or Blackfire." ]] + +# Check that blackfire can be enabled +docker run --rm -e PHP_EXTENSION_BLACKFIRE=1 thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT} php -m | grep blackfire - # Check that blackfire can be enabled - docker run --rm -e PHP_EXTENSION_BLACKFIRE=1 thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT} php -m | grep blackfire -fi # Let's check that the extensions are enabled when composer is run docker build -t test/composer_with_gd --build-arg PHP_VERSION="${PHP_VERSION}" --build-arg BRANCH="$BRANCH" --build-arg BRANCH_VARIANT="$BRANCH_VARIANT" tests/composer @@ -160,8 +144,8 @@ docker rmi test/composer_with_gd ################################# # Let's build the "node" images ################################# -docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}-node8 --build-arg PHP_VERSION=${PHP_VERSION} --build-arg GLOBAL_VERSION=${BRANCH} -f Dockerfile.${VARIANT}.node8 . -docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}-node10 --build-arg PHP_VERSION=${PHP_VERSION} --build-arg GLOBAL_VERSION=${BRANCH} -f Dockerfile.${VARIANT}.node10 . -docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}-node12 --build-arg PHP_VERSION=${PHP_VERSION} --build-arg GLOBAL_VERSION=${BRANCH} -f Dockerfile.${VARIANT}.node12 . +docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}-node8 -f Dockerfile.${PHP_VERSION}.${VARIANT}.node8 . +docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}-node10 -f Dockerfile.${PHP_VERSION}.${VARIANT}.node10 . +docker build -t thecodingmachine/php:${PHP_VERSION}-${BRANCH}-${BRANCH_VARIANT}-node12 -f Dockerfile.${PHP_VERSION}.${VARIANT}.node12 . echo "Tests passed with success" diff --git a/extensions/7.1/calendar b/extensions/7.1/calendar new file mode 120000 index 00000000..c99db6b2 --- /dev/null +++ b/extensions/7.1/calendar @@ -0,0 +1 @@ +../core/calendar \ No newline at end of file diff --git a/extensions/7.1/exif b/extensions/7.1/exif new file mode 120000 index 00000000..5544a525 --- /dev/null +++ b/extensions/7.1/exif @@ -0,0 +1 @@ +../core/exif \ No newline at end of file diff --git a/extensions/7.1/opcache b/extensions/7.1/opcache new file mode 120000 index 00000000..9280e6f4 --- /dev/null +++ b/extensions/7.1/opcache @@ -0,0 +1 @@ +../core/opcache \ No newline at end of file diff --git a/extensions/7.1/pcntl b/extensions/7.1/pcntl new file mode 120000 index 00000000..de3c97ef --- /dev/null +++ b/extensions/7.1/pcntl @@ -0,0 +1 @@ +../core/pcntl \ No newline at end of file diff --git a/extensions/7.1/pdo_mysql b/extensions/7.1/pdo_mysql new file mode 120000 index 00000000..401b7fbf --- /dev/null +++ b/extensions/7.1/pdo_mysql @@ -0,0 +1 @@ +../core/pdo_mysql \ No newline at end of file diff --git a/extensions/7.1/pdo_pgsql b/extensions/7.1/pdo_pgsql new file mode 120000 index 00000000..3a0bda2d --- /dev/null +++ b/extensions/7.1/pdo_pgsql @@ -0,0 +1 @@ +../core/pdo_pgsql \ No newline at end of file diff --git a/extensions/7.1/shmop b/extensions/7.1/shmop new file mode 120000 index 00000000..0668e598 --- /dev/null +++ b/extensions/7.1/shmop @@ -0,0 +1 @@ +../core/shmop \ No newline at end of file diff --git a/extensions/7.1/sockets b/extensions/7.1/sockets new file mode 120000 index 00000000..35c53432 --- /dev/null +++ b/extensions/7.1/sockets @@ -0,0 +1 @@ +../core/sockets \ No newline at end of file diff --git a/extensions/7.1/sysvmsg b/extensions/7.1/sysvmsg new file mode 120000 index 00000000..7076f03c --- /dev/null +++ b/extensions/7.1/sysvmsg @@ -0,0 +1 @@ +../core/sysvmsg \ No newline at end of file diff --git a/extensions/7.1/sysvsem b/extensions/7.1/sysvsem new file mode 120000 index 00000000..54c71ab6 --- /dev/null +++ b/extensions/7.1/sysvsem @@ -0,0 +1 @@ +../core/sysvsem \ No newline at end of file diff --git a/extensions/7.1/sysvshm b/extensions/7.1/sysvshm new file mode 120000 index 00000000..7019191a --- /dev/null +++ b/extensions/7.1/sysvshm @@ -0,0 +1 @@ +../core/sysvshm \ No newline at end of file diff --git a/extensions/7.1/wddx b/extensions/7.1/wddx new file mode 120000 index 00000000..cbbceb46 --- /dev/null +++ b/extensions/7.1/wddx @@ -0,0 +1 @@ +../core/wddx \ No newline at end of file diff --git a/extensions/7.1/xsl b/extensions/7.1/xsl new file mode 120000 index 00000000..00f9a998 --- /dev/null +++ b/extensions/7.1/xsl @@ -0,0 +1 @@ +../core/xsl \ No newline at end of file diff --git a/extensions/7.1/zip b/extensions/7.1/zip new file mode 120000 index 00000000..98c05831 --- /dev/null +++ b/extensions/7.1/zip @@ -0,0 +1 @@ +../core/zip \ No newline at end of file diff --git a/extensions/7.2/calendar b/extensions/7.2/calendar new file mode 120000 index 00000000..c99db6b2 --- /dev/null +++ b/extensions/7.2/calendar @@ -0,0 +1 @@ +../core/calendar \ No newline at end of file diff --git a/extensions/7.2/exif b/extensions/7.2/exif new file mode 120000 index 00000000..5544a525 --- /dev/null +++ b/extensions/7.2/exif @@ -0,0 +1 @@ +../core/exif \ No newline at end of file diff --git a/extensions/7.2/opcache b/extensions/7.2/opcache new file mode 120000 index 00000000..9280e6f4 --- /dev/null +++ b/extensions/7.2/opcache @@ -0,0 +1 @@ +../core/opcache \ No newline at end of file diff --git a/extensions/7.2/pcntl b/extensions/7.2/pcntl new file mode 120000 index 00000000..de3c97ef --- /dev/null +++ b/extensions/7.2/pcntl @@ -0,0 +1 @@ +../core/pcntl \ No newline at end of file diff --git a/extensions/7.2/pdo_mysql b/extensions/7.2/pdo_mysql new file mode 120000 index 00000000..401b7fbf --- /dev/null +++ b/extensions/7.2/pdo_mysql @@ -0,0 +1 @@ +../core/pdo_mysql \ No newline at end of file diff --git a/extensions/7.2/pdo_pgsql b/extensions/7.2/pdo_pgsql new file mode 120000 index 00000000..3a0bda2d --- /dev/null +++ b/extensions/7.2/pdo_pgsql @@ -0,0 +1 @@ +../core/pdo_pgsql \ No newline at end of file diff --git a/extensions/7.2/shmop b/extensions/7.2/shmop new file mode 120000 index 00000000..0668e598 --- /dev/null +++ b/extensions/7.2/shmop @@ -0,0 +1 @@ +../core/shmop \ No newline at end of file diff --git a/extensions/7.2/sockets b/extensions/7.2/sockets new file mode 120000 index 00000000..35c53432 --- /dev/null +++ b/extensions/7.2/sockets @@ -0,0 +1 @@ +../core/sockets \ No newline at end of file diff --git a/extensions/7.2/sysvmsg b/extensions/7.2/sysvmsg new file mode 120000 index 00000000..7076f03c --- /dev/null +++ b/extensions/7.2/sysvmsg @@ -0,0 +1 @@ +../core/sysvmsg \ No newline at end of file diff --git a/extensions/7.2/sysvsem b/extensions/7.2/sysvsem new file mode 120000 index 00000000..54c71ab6 --- /dev/null +++ b/extensions/7.2/sysvsem @@ -0,0 +1 @@ +../core/sysvsem \ No newline at end of file diff --git a/extensions/7.2/sysvshm b/extensions/7.2/sysvshm new file mode 120000 index 00000000..7019191a --- /dev/null +++ b/extensions/7.2/sysvshm @@ -0,0 +1 @@ +../core/sysvshm \ No newline at end of file diff --git a/extensions/7.2/wddx b/extensions/7.2/wddx new file mode 120000 index 00000000..cbbceb46 --- /dev/null +++ b/extensions/7.2/wddx @@ -0,0 +1 @@ +../core/wddx \ No newline at end of file diff --git a/extensions/7.2/xsl b/extensions/7.2/xsl new file mode 120000 index 00000000..00f9a998 --- /dev/null +++ b/extensions/7.2/xsl @@ -0,0 +1 @@ +../core/xsl \ No newline at end of file diff --git a/extensions/7.2/zip b/extensions/7.2/zip new file mode 120000 index 00000000..98c05831 --- /dev/null +++ b/extensions/7.2/zip @@ -0,0 +1 @@ +../core/zip \ No newline at end of file diff --git a/extensions/7.3/calendar b/extensions/7.3/calendar new file mode 120000 index 00000000..c99db6b2 --- /dev/null +++ b/extensions/7.3/calendar @@ -0,0 +1 @@ +../core/calendar \ No newline at end of file diff --git a/extensions/7.3/exif b/extensions/7.3/exif new file mode 120000 index 00000000..5544a525 --- /dev/null +++ b/extensions/7.3/exif @@ -0,0 +1 @@ +../core/exif \ No newline at end of file diff --git a/extensions/7.3/opcache b/extensions/7.3/opcache new file mode 120000 index 00000000..9280e6f4 --- /dev/null +++ b/extensions/7.3/opcache @@ -0,0 +1 @@ +../core/opcache \ No newline at end of file diff --git a/extensions/7.3/pcntl b/extensions/7.3/pcntl new file mode 120000 index 00000000..de3c97ef --- /dev/null +++ b/extensions/7.3/pcntl @@ -0,0 +1 @@ +../core/pcntl \ No newline at end of file diff --git a/extensions/7.3/pdo_mysql b/extensions/7.3/pdo_mysql new file mode 120000 index 00000000..401b7fbf --- /dev/null +++ b/extensions/7.3/pdo_mysql @@ -0,0 +1 @@ +../core/pdo_mysql \ No newline at end of file diff --git a/extensions/7.3/pdo_pgsql b/extensions/7.3/pdo_pgsql new file mode 120000 index 00000000..3a0bda2d --- /dev/null +++ b/extensions/7.3/pdo_pgsql @@ -0,0 +1 @@ +../core/pdo_pgsql \ No newline at end of file diff --git a/extensions/7.3/shmop b/extensions/7.3/shmop new file mode 120000 index 00000000..0668e598 --- /dev/null +++ b/extensions/7.3/shmop @@ -0,0 +1 @@ +../core/shmop \ No newline at end of file diff --git a/extensions/7.3/sockets b/extensions/7.3/sockets new file mode 120000 index 00000000..35c53432 --- /dev/null +++ b/extensions/7.3/sockets @@ -0,0 +1 @@ +../core/sockets \ No newline at end of file diff --git a/extensions/7.3/sysvmsg b/extensions/7.3/sysvmsg new file mode 120000 index 00000000..7076f03c --- /dev/null +++ b/extensions/7.3/sysvmsg @@ -0,0 +1 @@ +../core/sysvmsg \ No newline at end of file diff --git a/extensions/7.3/sysvsem b/extensions/7.3/sysvsem new file mode 120000 index 00000000..54c71ab6 --- /dev/null +++ b/extensions/7.3/sysvsem @@ -0,0 +1 @@ +../core/sysvsem \ No newline at end of file diff --git a/extensions/7.3/sysvshm b/extensions/7.3/sysvshm new file mode 120000 index 00000000..7019191a --- /dev/null +++ b/extensions/7.3/sysvshm @@ -0,0 +1 @@ +../core/sysvshm \ No newline at end of file diff --git a/extensions/7.3/wddx b/extensions/7.3/wddx new file mode 120000 index 00000000..cbbceb46 --- /dev/null +++ b/extensions/7.3/wddx @@ -0,0 +1 @@ +../core/wddx \ No newline at end of file diff --git a/extensions/7.3/xsl b/extensions/7.3/xsl new file mode 120000 index 00000000..00f9a998 --- /dev/null +++ b/extensions/7.3/xsl @@ -0,0 +1 @@ +../core/xsl \ No newline at end of file diff --git a/extensions/7.3/zip b/extensions/7.3/zip new file mode 120000 index 00000000..ce9601e0 --- /dev/null +++ b/extensions/7.3/zip @@ -0,0 +1 @@ +../core/zip-7.3 \ No newline at end of file diff --git a/extensions/7.4/apcu b/extensions/7.4/apcu deleted file mode 120000 index ddbb93d6..00000000 --- a/extensions/7.4/apcu +++ /dev/null @@ -1 +0,0 @@ -../core/apcu \ No newline at end of file diff --git a/extensions/7.4/ast b/extensions/7.4/ast deleted file mode 120000 index 5241c003..00000000 --- a/extensions/7.4/ast +++ /dev/null @@ -1 +0,0 @@ -../core/ast \ No newline at end of file diff --git a/extensions/7.4/bcmath b/extensions/7.4/bcmath deleted file mode 120000 index 36953ef1..00000000 --- a/extensions/7.4/bcmath +++ /dev/null @@ -1 +0,0 @@ -../core/bcmath \ No newline at end of file diff --git a/extensions/7.4/bz2 b/extensions/7.4/bz2 deleted file mode 120000 index 34eaa01d..00000000 --- a/extensions/7.4/bz2 +++ /dev/null @@ -1 +0,0 @@ -../core/bz2 \ No newline at end of file diff --git a/extensions/7.4/dba b/extensions/7.4/dba deleted file mode 120000 index f9598d4d..00000000 --- a/extensions/7.4/dba +++ /dev/null @@ -1 +0,0 @@ -../core/dba \ No newline at end of file diff --git a/extensions/7.4/disable_all.sh b/extensions/7.4/disable_all.sh deleted file mode 120000 index 36f58a80..00000000 --- a/extensions/7.4/disable_all.sh +++ /dev/null @@ -1 +0,0 @@ -../core/disable_all.sh \ No newline at end of file diff --git a/extensions/7.4/docker-install.sh b/extensions/7.4/docker-install.sh deleted file mode 120000 index 245891f8..00000000 --- a/extensions/7.4/docker-install.sh +++ /dev/null @@ -1 +0,0 @@ -../core/docker-install.sh \ No newline at end of file diff --git a/extensions/7.4/ds b/extensions/7.4/ds deleted file mode 120000 index edbe1af6..00000000 --- a/extensions/7.4/ds +++ /dev/null @@ -1 +0,0 @@ -../core/ds \ No newline at end of file diff --git a/extensions/7.4/enchant b/extensions/7.4/enchant deleted file mode 120000 index aa197129..00000000 --- a/extensions/7.4/enchant +++ /dev/null @@ -1 +0,0 @@ -../core/enchant \ No newline at end of file diff --git a/extensions/7.4/ev b/extensions/7.4/ev deleted file mode 120000 index d523a2c1..00000000 --- a/extensions/7.4/ev +++ /dev/null @@ -1 +0,0 @@ -../core/ev \ No newline at end of file diff --git a/extensions/7.4/event b/extensions/7.4/event deleted file mode 120000 index 67569f41..00000000 --- a/extensions/7.4/event +++ /dev/null @@ -1 +0,0 @@ -../core/event \ No newline at end of file diff --git a/extensions/7.4/gd b/extensions/7.4/gd deleted file mode 120000 index c4cfd1f9..00000000 --- a/extensions/7.4/gd +++ /dev/null @@ -1 +0,0 @@ -../core/gd \ No newline at end of file diff --git a/extensions/7.4/gettext b/extensions/7.4/gettext deleted file mode 120000 index 0369641a..00000000 --- a/extensions/7.4/gettext +++ /dev/null @@ -1 +0,0 @@ -../core/gettext \ No newline at end of file diff --git a/extensions/7.4/gmp b/extensions/7.4/gmp deleted file mode 120000 index d3dce5ec..00000000 --- a/extensions/7.4/gmp +++ /dev/null @@ -1 +0,0 @@ -../core/gmp \ No newline at end of file diff --git a/extensions/7.4/gnupg b/extensions/7.4/gnupg deleted file mode 120000 index 002cc7b2..00000000 --- a/extensions/7.4/gnupg +++ /dev/null @@ -1 +0,0 @@ -../core/gnupg \ No newline at end of file diff --git a/extensions/7.4/igbinary b/extensions/7.4/igbinary deleted file mode 120000 index c57a5ab9..00000000 --- a/extensions/7.4/igbinary +++ /dev/null @@ -1 +0,0 @@ -../core/igbinary \ No newline at end of file diff --git a/extensions/7.4/imagick b/extensions/7.4/imagick deleted file mode 120000 index 308094fe..00000000 --- a/extensions/7.4/imagick +++ /dev/null @@ -1 +0,0 @@ -../core/imagick/ \ No newline at end of file diff --git a/extensions/7.4/imap b/extensions/7.4/imap deleted file mode 120000 index 4ee55a28..00000000 --- a/extensions/7.4/imap +++ /dev/null @@ -1 +0,0 @@ -../core/imap \ No newline at end of file diff --git a/extensions/7.4/install_all.sh b/extensions/7.4/install_all.sh deleted file mode 120000 index 615edbef..00000000 --- a/extensions/7.4/install_all.sh +++ /dev/null @@ -1 +0,0 @@ -../core/install_all.sh \ No newline at end of file diff --git a/extensions/7.4/intl b/extensions/7.4/intl deleted file mode 120000 index dd21da0b..00000000 --- a/extensions/7.4/intl +++ /dev/null @@ -1 +0,0 @@ -../core/intl \ No newline at end of file diff --git a/extensions/7.4/ldap b/extensions/7.4/ldap deleted file mode 120000 index 394c7519..00000000 --- a/extensions/7.4/ldap +++ /dev/null @@ -1 +0,0 @@ -../core/ldap \ No newline at end of file diff --git a/extensions/7.4/memcached b/extensions/7.4/memcached deleted file mode 120000 index 13f2ea8c..00000000 --- a/extensions/7.4/memcached +++ /dev/null @@ -1 +0,0 @@ -../core/memcached \ No newline at end of file diff --git a/extensions/7.4/mongodb b/extensions/7.4/mongodb deleted file mode 120000 index 7898c8e7..00000000 --- a/extensions/7.4/mongodb +++ /dev/null @@ -1 +0,0 @@ -../core/mongodb \ No newline at end of file diff --git a/extensions/7.4/msgpack b/extensions/7.4/msgpack deleted file mode 120000 index 2a72eaa8..00000000 --- a/extensions/7.4/msgpack +++ /dev/null @@ -1 +0,0 @@ -../core/msgpack \ No newline at end of file diff --git a/extensions/7.4/mysqli b/extensions/7.4/mysqli deleted file mode 120000 index f752c283..00000000 --- a/extensions/7.4/mysqli +++ /dev/null @@ -1 +0,0 @@ -../core/mysqli \ No newline at end of file diff --git a/extensions/7.4/pcov b/extensions/7.4/pcov deleted file mode 120000 index b99a0dd2..00000000 --- a/extensions/7.4/pcov +++ /dev/null @@ -1 +0,0 @@ -../core/pcov \ No newline at end of file diff --git a/extensions/7.4/pdo_dblib b/extensions/7.4/pdo_dblib deleted file mode 120000 index 2261140c..00000000 --- a/extensions/7.4/pdo_dblib +++ /dev/null @@ -1 +0,0 @@ -../core/pdo_dblib \ No newline at end of file diff --git a/extensions/7.4/pgsql b/extensions/7.4/pgsql deleted file mode 120000 index 29ac8e8b..00000000 --- a/extensions/7.4/pgsql +++ /dev/null @@ -1 +0,0 @@ -../core/pgsql \ No newline at end of file diff --git a/extensions/7.4/pspell b/extensions/7.4/pspell deleted file mode 120000 index 9be96fd9..00000000 --- a/extensions/7.4/pspell +++ /dev/null @@ -1 +0,0 @@ -../core/pspell \ No newline at end of file diff --git a/extensions/7.4/redis b/extensions/7.4/redis deleted file mode 120000 index 0727c021..00000000 --- a/extensions/7.4/redis +++ /dev/null @@ -1 +0,0 @@ -../core/redis \ No newline at end of file diff --git a/extensions/7.4/snmp b/extensions/7.4/snmp deleted file mode 120000 index f2249ffe..00000000 --- a/extensions/7.4/snmp +++ /dev/null @@ -1 +0,0 @@ -../core/snmp \ No newline at end of file diff --git a/extensions/7.4/soap b/extensions/7.4/soap deleted file mode 120000 index ea63abf6..00000000 --- a/extensions/7.4/soap +++ /dev/null @@ -1 +0,0 @@ -../core/soap \ No newline at end of file diff --git a/extensions/7.4/swoole b/extensions/7.4/swoole deleted file mode 120000 index f20d56ed..00000000 --- a/extensions/7.4/swoole +++ /dev/null @@ -1 +0,0 @@ -../core/swoole \ No newline at end of file diff --git a/extensions/7.4/tidy b/extensions/7.4/tidy deleted file mode 120000 index e0434e64..00000000 --- a/extensions/7.4/tidy +++ /dev/null @@ -1 +0,0 @@ -../core/tidy \ No newline at end of file diff --git a/extensions/7.4/xdebug b/extensions/7.4/xdebug deleted file mode 120000 index ee4c5321..00000000 --- a/extensions/7.4/xdebug +++ /dev/null @@ -1 +0,0 @@ -../core/xdebug/ \ No newline at end of file diff --git a/extensions/7.4/xmlrpc b/extensions/7.4/xmlrpc deleted file mode 120000 index 2833c799..00000000 --- a/extensions/7.4/xmlrpc +++ /dev/null @@ -1 +0,0 @@ -../core/xmlrpc \ No newline at end of file diff --git a/extensions/7.4/yaml b/extensions/7.4/yaml deleted file mode 120000 index 4be2658a..00000000 --- a/extensions/7.4/yaml +++ /dev/null @@ -1 +0,0 @@ -../core/yaml \ No newline at end of file diff --git a/extensions/core/amqp/install.sh b/extensions/core/amqp/install.sh index 888b2ef5..4dcca1e6 100755 --- a/extensions/core/amqp/install.sh +++ b/extensions/core/amqp/install.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e -export EXTENSION=amqp +export PECL_EXTENSION=amqp +export DEV_DEPENDENCIES="librabbitmq-dev" +export DEPENDENCIES="librabbitmq4" ../docker-install.sh diff --git a/extensions/core/ast/install.sh b/extensions/core/ast/install.sh index c667abce..9df5fdf2 100755 --- a/extensions/core/ast/install.sh +++ b/extensions/core/ast/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -e -export EXTENSION=ast +export PECL_EXTENSION=ast ../docker-install.sh diff --git a/extensions/core/blackfire/install.sh b/extensions/core/blackfire/install.sh index b76b0739..1d5d30b6 100755 --- a/extensions/core/blackfire/install.sh +++ b/extensions/core/blackfire/install.sh @@ -11,11 +11,6 @@ tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz -echo "extension=blackfire.so" > /etc/php/${PHP_VERSION}/mods-available/blackfire.ini -# Adding this in the list of Ubuntu extensions because we use that list as a base for the modules list. -# TODO: question: cannot we use /etc/php/mods-available instead??? -touch /var/lib/php/modules/${PHP_VERSION}/registry/blackfire - # Install Blackfire CLI tool mkdir -p /tmp/blackfire curl -A "Docker" -L https://blackfire.io/api/v1/releases/client/linux_static/amd64 | tar zxp -C /tmp/blackfire diff --git a/extensions/core/bz2/install.sh b/extensions/core/bz2/install.sh index 7979cb76..357aa85d 100755 --- a/extensions/core/bz2/install.sh +++ b/extensions/core/bz2/install.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -EXTENSION=bz2 ../docker-install.sh +EXTENSION=bz2 DEV_DEPENDENCIES=libbz2-dev ../docker-install.sh diff --git a/extensions/core/calendar/install.sh b/extensions/core/calendar/install.sh new file mode 100755 index 00000000..75218208 --- /dev/null +++ b/extensions/core/calendar/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +EXTENSION=calendar ../docker-install.sh diff --git a/extensions/core/disable_all.sh b/extensions/core/disable_all.sh index 42ebf242..3c4aa513 100755 --- a/extensions/core/disable_all.sh +++ b/extensions/core/disable_all.sh @@ -5,9 +5,8 @@ set -ex for ext in */; do \ ext_no_slash=${ext%/} - if compgen -G "/etc/php/${PHP_VERSION}/cli/conf.d/*-$ext_no_slash.ini" > /dev/null; then + if [ -f /usr/local/etc/php/conf.d/docker-php-ext-$ext_no_slash.ini ]; then echo "***************** Disabling $ext_no_slash ******************" - #rm -f /etc/php/${PHP_VERSION}/cli/conf.d/*-$ext_no_slash.ini - phpdismod $ext_no_slash + rm -f /usr/local/etc/php/conf.d/docker-php-ext-$ext_no_slash.ini fi done diff --git a/extensions/core/docker-install.sh b/extensions/core/docker-install.sh index 4e736595..75235d21 100755 --- a/extensions/core/docker-install.sh +++ b/extensions/core/docker-install.sh @@ -12,33 +12,11 @@ if [ -n "$CONFIGURE_OPTIONS" ]; then fi if [ -n "$EXTENSION" ]; then - set +e - if apt-cache search --names-only "php${PHP_VERSION}-$EXTENSION" | grep "php${PHP_VERSION}-$EXTENSION"; then - set -e - apt-get install -y --no-install-recommends php${PHP_VERSION}-$EXTENSION - else - set -e - apt-get install -y --no-install-recommends php-$EXTENSION - fi - + docker-php-ext-install $EXTENSION fi if [ -n "$PECL_EXTENSION" ]; then - # if env ready? - - # is phpize installed? - if which pecl && which phpize; then - echo "pecl found" - which pecl - else - apt-get install -y --no-install-recommends build-essential php-pear php${PHP_VERSION}-dev pkg-config - fi - pecl install $PECL_EXTENSION - echo "extension=${PHP_EXT_NAME:-${PECL_EXTENSION}}.so" > /etc/php/${PHP_VERSION}/mods-available/${PHP_EXT_NAME:-${PECL_EXTENSION}}.ini - # Adding this in the list of Ubuntu extensions because we use that list as a base for the modules list. - # TODO: question: cannot we use /etc/php/mods-available instead??? - touch /var/lib/php/modules/${PHP_VERSION}/registry/${PHP_EXT_NAME:-${PECL_EXTENSION}} fi if [ -n "$DEV_DEPENDENCIES" ]; then @@ -47,24 +25,20 @@ fi if [ -n "$EXTENSION" ]; then # Let's perform a test - php -m | grep "${PHP_EXT_PHP_NAME:-${PHP_EXT_NAME:-$EXTENSION}}" + php -m | grep $EXTENSION # Check that there is no output on STDERR when starting php: OUTPUT=`php -r "echo '';" 2>&1` [[ "$OUTPUT" == "" ]] # And now, let's disable it! - rm -f /etc/php/${PHP_VERSION}/cli/conf.d/*-$EXTENSION.ini - rm -f /etc/php/${PHP_VERSION}/apache/conf.d/*-$EXTENSION.ini - rm -f /etc/php/${PHP_VERSION}/fpm/conf.d/*-$EXTENSION.ini + rm -f /usr/local/etc/php/conf.d/docker-php-ext-$EXTENSION.ini fi if [ -n "$PECL_EXTENSION" ]; then # Let's perform a test - PHP_EXTENSIONS="${PHP_EXT_NAME:-$PECL_EXTENSION}" php /usr/local/bin/setup_extensions.php | bash - PHP_EXTENSIONS="${PHP_EXT_NAME:-$PECL_EXTENSION}" php /usr/local/bin/generate_conf.php > /etc/php/${PHP_VERSION}/cli/conf.d/testextension.ini + PHP_EXTENSIONS="${PHP_EXT_NAME:-$PECL_EXTENSION}" php /usr/local/bin/generate_conf.php > /usr/local/etc/php/conf.d/testextension.ini php -m | grep "${PHP_EXT_PHP_NAME:-${PHP_EXT_NAME:-$PECL_EXTENSION}}" # Check that there is no output on STDERR when starting php: OUTPUT=`php -r "echo '';" 2>&1` [[ "$OUTPUT" == "" ]] - PHP_EXTENSIONS="" php /usr/local/bin/setup_extensions.php | bash - rm /etc/php/${PHP_VERSION}/cli/conf.d/testextension.ini + rm /usr/local/etc/php/conf.d/testextension.ini fi diff --git a/extensions/core/ds/install.sh b/extensions/core/ds/install.sh index e0cfcfe7..963d5b21 100755 --- a/extensions/core/ds/install.sh +++ b/extensions/core/ds/install.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -EXTENSION=ds ../docker-install.sh +PECL_EXTENSION=ds ../docker-install.sh diff --git a/extensions/core/enchant/install.sh b/extensions/core/enchant/install.sh index 1e635978..fe757d73 100755 --- a/extensions/core/enchant/install.sh +++ b/extensions/core/enchant/install.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -EXTENSION=enchant ../docker-install.sh +EXTENSION=enchant DEV_DEPENDENCIES=libenchant-dev DEPENDENCIES=libenchant1c2a ../docker-install.sh diff --git a/extensions/core/event/install.sh b/extensions/core/event/install.sh index dd4f2bde..782ed3bf 100755 --- a/extensions/core/event/install.sh +++ b/extensions/core/event/install.sh @@ -2,9 +2,9 @@ set -e # Sockets is required for event extension to work. -#export EXTENSION="sockets" +export EXTENSION="sockets" export PECL_EXTENSION="event" export DEV_DEPENDENCIES="libevent-dev libssl-dev" -export DEPENDENCIES="libevent-2.1-6 libevent-core-2.1-6 libevent-extra-2.1-6 libevent-openssl-2.1-6 libevent-pthreads-2.1-6 libssl1.1" +export DEPENDENCIES="libevent-2.0-5 libevent-core-2.0-5 libevent-extra-2.0-5 libevent-openssl-2.0-5 libevent-pthreads-2.0-5" ../docker-install.sh diff --git a/extensions/core/exif/install.sh b/extensions/core/exif/install.sh new file mode 100755 index 00000000..0acfd3fe --- /dev/null +++ b/extensions/core/exif/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +EXTENSION=exif ../docker-install.sh diff --git a/extensions/core/gd/install.sh b/extensions/core/gd/install.sh index 75ea4f85..44dd8f42 100755 --- a/extensions/core/gd/install.sh +++ b/extensions/core/gd/install.sh @@ -2,8 +2,8 @@ set -e export EXTENSION=gd -#export DEV_DEPENDENCIES="libjpeg62-turbo-dev libpng-dev libxpm-dev libfreetype6-dev" -#export DEPENDENCIES="libjpeg62-turbo libpng16-16 zlib1g libxpm4 libfreetype6" -#export CONFIGURE_OPTIONS="--with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-xpm-dir=/usr/include/" +export DEV_DEPENDENCIES="libjpeg62-turbo-dev libpng-dev libxpm-dev libfreetype6-dev" +export DEPENDENCIES="libjpeg62-turbo libpng16-16 zlib1g libxpm4 libfreetype6" +export CONFIGURE_OPTIONS="--with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-xpm-dir=/usr/include/" ../docker-install.sh diff --git a/extensions/core/gmp/install.sh b/extensions/core/gmp/install.sh index 28a4a0dc..64e04bdd 100755 --- a/extensions/core/gmp/install.sh +++ b/extensions/core/gmp/install.sh @@ -2,5 +2,7 @@ set -e export EXTENSION=gmp +export DEV_DEPENDENCIES="libgmp3-dev" +export DEPENDENCIES="libgmp10 libgmpxx4ldbl" ../docker-install.sh diff --git a/extensions/core/gnupg/install.sh b/extensions/core/gnupg/install.sh index 1938a05b..dd65d1d6 100755 --- a/extensions/core/gnupg/install.sh +++ b/extensions/core/gnupg/install.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e -export EXTENSION=gnupg +export PECL_EXTENSION=gnupg +export DEV_DEPENDENCIES="libgpgme11-dev" +export DEPENDENCIES="libgpgme11" ../docker-install.sh diff --git a/extensions/core/igbinary/install.sh b/extensions/core/igbinary/install.sh index 4f27ac9c..e461931b 100755 --- a/extensions/core/igbinary/install.sh +++ b/extensions/core/igbinary/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -e -export EXTENSION=igbinary +export PECL_EXTENSION=igbinary ../docker-install.sh diff --git a/extensions/core/imagick/install.sh b/extensions/core/imagick/install.sh index 14e2c50a..3e4cade5 100755 --- a/extensions/core/imagick/install.sh +++ b/extensions/core/imagick/install.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -e -export EXTENSION=imagick +export PECL_EXTENSION=imagick +export DEV_DEPENDENCIES="libmagickwand-dev libmagickcore-dev" +export DEPENDENCIES="imagemagick-6-common libmagickcore-6.q16-3 libmagickwand-6.q16-3 imagemagick-6-common gsfonts libmagickcore-6.q16-3-extra ghostscript ttf-dejavu-core" ../docker-install.sh diff --git a/extensions/core/imap/install.sh b/extensions/core/imap/install.sh index e2c181ac..72204195 100755 --- a/extensions/core/imap/install.sh +++ b/extensions/core/imap/install.sh @@ -2,5 +2,8 @@ set -e export EXTENSION=imap +export DEV_DEPENDENCIES="libc-client-dev libkrb5-dev" +export DEPENDENCIES="libgssapi-krb5-2 libgssrpc4 libk5crypto3 libkadm5clnt-mit11 libkadm5srv-mit11 libkrb5-3 libcomerr2 libc-client2007e libpam0g libssl1.1" +export CONFIGURE_OPTIONS="--with-imap --with-kerberos --with-imap-ssl" ../docker-install.sh diff --git a/extensions/core/install_all.sh b/extensions/core/install_all.sh index 0e2a174e..dae3a26c 100755 --- a/extensions/core/install_all.sh +++ b/extensions/core/install_all.sh @@ -1,10 +1,7 @@ #!/usr/bin/env bash set -e -set +x - -# Let's disable autoclean of package list after apt-get install -mv /etc/apt/apt.conf.d/docker-clean /tmp/docker-clean +set -ex apt-get update @@ -15,11 +12,3 @@ for ext in */; do \ ./install.sh cd .. done - -# Let's enable autoclean again -mv /tmp/docker-clean /etc/apt/apt.conf.d/docker-clean - -apt-get purge -y php-pear build-essential php${PHP_VERSION}-dev pkg-config -apt-get autoremove -y -apt-get clean -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* diff --git a/extensions/core/intl/install.sh b/extensions/core/intl/install.sh index 2da03435..173ce438 100755 --- a/extensions/core/intl/install.sh +++ b/extensions/core/intl/install.sh @@ -2,5 +2,7 @@ set -e export EXTENSION=intl +export DEV_DEPENDENCIES="libicu-dev" +export DEPENDENCIES="libicu57" ../docker-install.sh diff --git a/extensions/core/ldap/install.sh b/extensions/core/ldap/install.sh index d31ba6a2..632c5ae8 100755 --- a/extensions/core/ldap/install.sh +++ b/extensions/core/ldap/install.sh @@ -1,8 +1,12 @@ #!/usr/bin/env bash set -e +set -ex -set -e -export EXTENSION=ldap +apt-get install -y --no-install-recommends libldap2-dev libldap-2.4-2 +#ln -s /usr/lib/x86_64-linux-gnu/libldap_r.so /usr/lib/libldap.so +#ln -s /usr/lib/x86_64-linux-gnu/libldap_r.a /usr/lib/libldap_r.a + +docker-php-ext-install ldap -../docker-install.sh +apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false libldap2-dev diff --git a/extensions/core/mailparse/install.sh b/extensions/core/mailparse/install.sh index e7d13311..386dd00e 100755 --- a/extensions/core/mailparse/install.sh +++ b/extensions/core/mailparse/install.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -EXTENSION=mailparse ../docker-install.sh +PECL_EXTENSION=mailparse ../docker-install.sh diff --git a/extensions/core/memcached/install.sh b/extensions/core/memcached/install.sh index 1de22277..4a3cab7e 100755 --- a/extensions/core/memcached/install.sh +++ b/extensions/core/memcached/install.sh @@ -1,13 +1,8 @@ #!/usr/bin/env bash set -e -export DEPENDENCIES="php-igbinary php-msgpack" -export EXTENSION=memcached - -# we need to do some weird stuff to get memcached working -phpdismod igbinary -phpenmod igbinary +export PECL_EXTENSION=memcached +export DEV_DEPENDENCIES="libmemcached-dev zlib1g-dev" +export DEPENDENCIES="libmemcached11 libmemcachedutil2 zlib1g" ../docker-install.sh - -phpdismod igbinary \ No newline at end of file diff --git a/extensions/core/mongodb/install.sh b/extensions/core/mongodb/install.sh index 48464bfb..edc04fcd 100755 --- a/extensions/core/mongodb/install.sh +++ b/extensions/core/mongodb/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -e -export EXTENSION=mongodb +export PECL_EXTENSION=mongodb ../docker-install.sh diff --git a/extensions/core/msgpack/install.sh b/extensions/core/msgpack/install.sh index 3ec52567..8b20c9cd 100755 --- a/extensions/core/msgpack/install.sh +++ b/extensions/core/msgpack/install.sh @@ -1,4 +1,4 @@ #!/usr/bin/env bash set -e -EXTENSION=msgpack ../docker-install.sh +PECL_EXTENSION=msgpack ../docker-install.sh diff --git a/extensions/core/mysqli/install.sh b/extensions/core/mysqli/install.sh index 0b98b68c..da6924da 100755 --- a/extensions/core/mysqli/install.sh +++ b/extensions/core/mysqli/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -e -export EXTENSION=mysql +export EXTENSION=mysqli ../docker-install.sh diff --git a/extensions/core/opcache/install.sh b/extensions/core/opcache/install.sh new file mode 100755 index 00000000..4caac10b --- /dev/null +++ b/extensions/core/opcache/install.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +docker-php-ext-install opcache + +php -m | grep "Zend OPcache" +# And now, let's disable it! +rm /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini diff --git a/extensions/core/pcntl/install.sh b/extensions/core/pcntl/install.sh new file mode 100755 index 00000000..ecf3453a --- /dev/null +++ b/extensions/core/pcntl/install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e +export EXTENSION=pcntl + +../docker-install.sh diff --git a/extensions/core/pcov/install.sh b/extensions/core/pcov/install.sh index ceaa9a87..4f172cae 100755 --- a/extensions/core/pcov/install.sh +++ b/extensions/core/pcov/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -e -export EXTENSION=pcov +export PECL_EXTENSION=pcov ../docker-install.sh diff --git a/extensions/core/pdo_dblib/install.sh b/extensions/core/pdo_dblib/install.sh index d1c70682..ccf09709 100755 --- a/extensions/core/pdo_dblib/install.sh +++ b/extensions/core/pdo_dblib/install.sh @@ -1,8 +1,12 @@ #!/usr/bin/env bash set -e -set -e -export EXTENSION=sybase -export PHP_EXT_NAME=dblib +set -ex + +apt-get install -y --no-install-recommends freetds-dev libsybdb5 libct4 +ln -s /usr/lib/x86_64-linux-gnu/libsybdb.a /usr/lib/libsybdb.a +ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so + +docker-php-ext-install pdo_dblib -../docker-install.sh +apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false freetds-dev diff --git a/extensions/core/pdo_mysql/install.sh b/extensions/core/pdo_mysql/install.sh new file mode 100755 index 00000000..7466e858 --- /dev/null +++ b/extensions/core/pdo_mysql/install.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -e +export EXTENSION=pdo_mysql + +../docker-install.sh diff --git a/extensions/core/pdo_pgsql/install.sh b/extensions/core/pdo_pgsql/install.sh new file mode 100755 index 00000000..e7c59f4e --- /dev/null +++ b/extensions/core/pdo_pgsql/install.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +export EXTENSION=pdo_pgsql +export DEV_DEPENDENCIES="libpq-dev" +export DEPENDENCIES="libpq5 libc6" + +../docker-install.sh diff --git a/extensions/core/pgsql/install.sh b/extensions/core/pgsql/install.sh index d6dec14f..e37211e8 100755 --- a/extensions/core/pgsql/install.sh +++ b/extensions/core/pgsql/install.sh @@ -2,5 +2,7 @@ set -e export EXTENSION=pgsql +export DEV_DEPENDENCIES="libpq-dev" +export DEPENDENCIES="libpq5 libc6" ../docker-install.sh diff --git a/extensions/core/pspell/install.sh b/extensions/core/pspell/install.sh index 4ecfbcd8..c090736d 100755 --- a/extensions/core/pspell/install.sh +++ b/extensions/core/pspell/install.sh @@ -2,5 +2,7 @@ set -e export EXTENSION=pspell +export DEV_DEPENDENCIES="libpspell-dev" +export DEPENDENCIES="libaspell15" ../docker-install.sh diff --git a/extensions/core/redis/install.sh b/extensions/core/redis/install.sh index 034e85b6..692d6027 100755 --- a/extensions/core/redis/install.sh +++ b/extensions/core/redis/install.sh @@ -1,12 +1,6 @@ #!/usr/bin/env bash set -e -export EXTENSION=redis - -# we need to do some weird stuff to get memcached working -phpdismod igbinary -phpenmod igbinary +export PECL_EXTENSION=redis ../docker-install.sh - -phpdismod igbinary diff --git a/extensions/core/shmop/install.sh b/extensions/core/shmop/install.sh new file mode 100755 index 00000000..3f02a7ba --- /dev/null +++ b/extensions/core/shmop/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +EXTENSION=shmop ../docker-install.sh diff --git a/extensions/core/soap/install.sh b/extensions/core/soap/install.sh index 0d79262a..56b99568 100755 --- a/extensions/core/soap/install.sh +++ b/extensions/core/soap/install.sh @@ -2,6 +2,8 @@ set -e export EXTENSION=soap +export DEV_DEPENDENCIES="libxml2-dev" +export DEPENDENCIES="libxml2 libicu57" ../docker-install.sh diff --git a/extensions/core/sockets/install.sh b/extensions/core/sockets/install.sh new file mode 100755 index 00000000..7b0891cd --- /dev/null +++ b/extensions/core/sockets/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +EXTENSION=sockets ../docker-install.sh diff --git a/extensions/core/swoole/install.sh b/extensions/core/swoole/install.sh index 5155e6f7..cb8c3e59 100755 --- a/extensions/core/swoole/install.sh +++ b/extensions/core/swoole/install.sh @@ -1,4 +1,6 @@ #!/usr/bin/env bash set -e +export DEV_DEPENDENCIES="zlib1g-dev" +export DEPENDENCIES="zlib1g" PECL_EXTENSION=swoole ../docker-install.sh diff --git a/extensions/core/sysvmsg/install.sh b/extensions/core/sysvmsg/install.sh new file mode 100755 index 00000000..6037b71a --- /dev/null +++ b/extensions/core/sysvmsg/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +EXTENSION=sysvmsg ../docker-install.sh diff --git a/extensions/core/sysvsem/install.sh b/extensions/core/sysvsem/install.sh new file mode 100755 index 00000000..6a1fd2a4 --- /dev/null +++ b/extensions/core/sysvsem/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +EXTENSION=sysvsem ../docker-install.sh diff --git a/extensions/core/sysvshm/install.sh b/extensions/core/sysvshm/install.sh new file mode 100755 index 00000000..dbe6cd08 --- /dev/null +++ b/extensions/core/sysvshm/install.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +set -e +EXTENSION=sysvshm ../docker-install.sh diff --git a/extensions/core/tidy/install.sh b/extensions/core/tidy/install.sh index 1516eee3..cc7d460b 100755 --- a/extensions/core/tidy/install.sh +++ b/extensions/core/tidy/install.sh @@ -2,5 +2,7 @@ set -e export EXTENSION=tidy +export DEV_DEPENDENCIES="libtidy-dev" +export DEPENDENCIES="libtidy5" ../docker-install.sh diff --git a/extensions/core/wddx/install.sh b/extensions/core/wddx/install.sh new file mode 100755 index 00000000..4ed942e3 --- /dev/null +++ b/extensions/core/wddx/install.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +export EXTENSION=wddx +export DEV_DEPENDENCIES="libxml2-dev" +export DEPENDENCIES="libxml2 libicu57 expat" + +../docker-install.sh diff --git a/extensions/core/xdebug/install.sh b/extensions/core/xdebug/install.sh index 9af11834..43f15e3d 100755 --- a/extensions/core/xdebug/install.sh +++ b/extensions/core/xdebug/install.sh @@ -2,4 +2,4 @@ set -e # We need the "host" command to detect the remote host on MacOS and Windows -EXTENSION=xdebug DEPENDENCIES="bind9-host" ../docker-install.sh +PECL_EXTENSION=xdebug DEPENDENCIES="bind9-host" ../docker-install.sh diff --git a/extensions/core/xmlrpc/install.sh b/extensions/core/xmlrpc/install.sh index 3c38826c..ef7caa72 100755 --- a/extensions/core/xmlrpc/install.sh +++ b/extensions/core/xmlrpc/install.sh @@ -2,6 +2,8 @@ set -e export EXTENSION=xmlrpc +export DEV_DEPENDENCIES="libxml2-dev" +export DEPENDENCIES="libxml2 libicu57" ../docker-install.sh diff --git a/extensions/core/xsl/install.sh b/extensions/core/xsl/install.sh new file mode 100755 index 00000000..b50b64ee --- /dev/null +++ b/extensions/core/xsl/install.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +export EXTENSION=xsl +export DEV_DEPENDENCIES="libxml2-dev libxslt1-dev" +export DEPENDENCIES="libxml2 libicu57 libxslt1.1" + +../docker-install.sh diff --git a/extensions/core/yaml/install.sh b/extensions/core/yaml/install.sh index bbccba66..aefb0c8c 100755 --- a/extensions/core/yaml/install.sh +++ b/extensions/core/yaml/install.sh @@ -1,6 +1,9 @@ #!/usr/bin/env bash set -e -export EXTENSION=yaml +export PECL_EXTENSION=yaml +export DEV_DEPENDENCIES="libyaml-dev" +export DEPENDENCIES="libyaml-0-2" + ../docker-install.sh diff --git a/extensions/core/zip-7.3/install.sh b/extensions/core/zip-7.3/install.sh new file mode 100755 index 00000000..dc8c2ce6 --- /dev/null +++ b/extensions/core/zip-7.3/install.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e +export EXTENSION=zip +export DEV_DEPENDENCIES="libzip-dev" +export DEPENDENCIES="libzip4" + +../docker-install.sh diff --git a/extensions/core/zip/install.sh b/extensions/core/zip/install.sh index ba0c65a1..6449a892 100755 --- a/extensions/core/zip/install.sh +++ b/extensions/core/zip/install.sh @@ -2,5 +2,7 @@ set -e export EXTENSION=zip +export DEV_DEPENDENCIES="zlib1g-dev" +export DEPENDENCIES="zlib1g" ../docker-install.sh diff --git a/images.yml b/images.yml index ed2ddc86..911dde05 100644 --- a/images.yml +++ b/images.yml @@ -1 +1,4 @@ -php_version: 7.4 +php_version: 7.2 +compiled_php_extensions: mbstring ftp mysqlnd +enabled_php_extensions: apcu mysqli opcache pdo_mysql redis zip soap +disabled_php_extensions: amqp ast bcmath blackfire bz2 calendar dba ds enchant ev event exif mailparse msgpack gd gettext gmp gnupg igbinary imagick imap intl ldap mcrypt memcached mongodb pcntl pcov pdo_dblib pdo_pgsql pgsql pspell shmop snmp sockets swoole sysvmsg sysvsem sysvshm tidy wddx weakref(-beta) xdebug xmlrpc xsl yaml diff --git a/orbit.yml b/orbit.yml index 95f430c6..8e3dc056 100644 --- a/orbit.yml +++ b/orbit.yml @@ -19,20 +19,52 @@ tasks: - use: generate short: Generates all Dockerfiles and the README.md file run: - - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.slim.apache -p "variant,apache" - - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.slim.cli -p "variant,cli" - - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.slim.fpm -p "variant,fpm" - - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.apache -p "variant,apache;node_version," - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.apache.node8 -p "variant,apache;node_version,8" - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.apache.node10 -p "variant,apache;node_version,10" - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.apache.node12 -p "variant,apache;node_version,12" - - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.cli -p "variant,cli;node_version," - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.cli.node8 -p "variant,cli;node_version,8" - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.cli.node10 -p "variant,cli;node_version,10" - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.cli.node12 -p "variant,cli;node_version,12" - - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.fpm -p "variant,fpm;node_version," - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.fpm.node8 -p "variant,fpm;node_version,8" - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.fpm.node10 -p "variant,fpm;node_version,10" - - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.fpm.node12 -p "variant,fpm;node_version,12" + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.1.slim.apache -p "php_version,7.1;variant,apache" + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.1.slim.cli -p "php_version,7.1;variant,cli" + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.1.slim.fpm -p "php_version,7.1;variant,fpm" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.1.apache -p "php_version,7.1;variant,apache;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.apache.node8 -p "php_version,7.1;variant,apache;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.apache.node10 -p "php_version,7.1;variant,apache;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.apache.node12 -p "php_version,7.1;variant,apache;node_version,12" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.1.cli -p "php_version,7.1;variant,cli;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.cli.node8 -p "php_version,7.1;variant,cli;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.cli.node10 -p "php_version,7.1;variant,cli;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.cli.node12 -p "php_version,7.1;variant,cli;node_version,12" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.1.fpm -p "php_version,7.1;variant,fpm;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.fpm.node8 -p "php_version,7.1;variant,fpm;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.fpm.node10 -p "php_version,7.1;variant,fpm;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.1.fpm.node12 -p "php_version,7.1;variant,fpm;node_version,12" + + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.2.slim.apache -p "php_version,7.2;variant,apache" + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.2.slim.cli -p "php_version,7.2;variant,cli" + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.2.slim.fpm -p "php_version,7.2;variant,fpm" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.2.apache -p "php_version,7.2;variant,apache;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.apache.node8 -p "php_version,7.2;variant,apache;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.apache.node10 -p "php_version,7.2;variant,apache;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.apache.node12 -p "php_version,7.2;variant,apache;node_version,12" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.2.cli -p "php_version,7.2;variant,cli;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.cli.node8 -p "php_version,7.2;variant,cli;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.cli.node10 -p "php_version,7.2;variant,cli;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.cli.node12 -p "php_version,7.2;variant,cli;node_version,12" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.2.fpm -p "php_version,7.2;variant,fpm;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.fpm.node8 -p "php_version,7.2;variant,fpm;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.fpm.node10 -p "php_version,7.2;variant,fpm;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.2.fpm.node12 -p "php_version,7.2;variant,fpm;node_version,12" + + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.3.slim.apache -p "php_version,7.3;variant,apache" + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.3.slim.cli -p "php_version,7.3;variant,cli" + - orbit generate -f utils/Dockerfile.slim.blueprint -o Dockerfile.7.3.slim.fpm -p "php_version,7.3;variant,fpm" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.3.apache -p "php_version,7.3;variant,apache;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.apache.node8 -p "php_version,7.3;variant,apache;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.apache.node10 -p "php_version,7.3;variant,apache;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.apache.node12 -p "php_version,7.3;variant,apache;node_version,12" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.3.cli -p "php_version,7.3;variant,cli;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.cli.node8 -p "php_version,7.3;variant,cli;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.cli.node10 -p "php_version,7.3;variant,cli;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.cli.node12 -p "php_version,7.3;variant,cli;node_version,12" + - orbit generate -f utils/Dockerfile.blueprint -o Dockerfile.7.3.fpm -p "php_version,7.3;variant,fpm;node_version," + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.fpm.node8 -p "php_version,7.3;variant,fpm;node_version,8" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.fpm.node10 -p "php_version,7.3;variant,fpm;node_version,10" + - orbit generate -f utils/Dockerfile.node.blueprint -o Dockerfile.7.3.fpm.node12 -p "php_version,7.3;variant,fpm;node_version,12" - orbit generate -f utils/README.blueprint.md -o README.md diff --git a/tests/slim_onbuild/Dockerfile b/tests/slim_onbuild/Dockerfile index 4063b492..56d4abc4 100644 --- a/tests/slim_onbuild/Dockerfile +++ b/tests/slim_onbuild/Dockerfile @@ -2,5 +2,5 @@ ARG BRANCH ARG BRANCH_VARIANT ARG PHP_VERSION -ARG PHP_EXTENSIONS="xdebug" +ARG PHP_EXTENSIONS="sockets xdebug" FROM thecodingmachine/php:${PHP_VERSION}-${BRANCH}-slim-${BRANCH_VARIANT} diff --git a/utils/Dockerfile.blueprint b/utils/Dockerfile.blueprint index 81cbcb08..fd2933ce 100644 --- a/utils/Dockerfile.blueprint +++ b/utils/Dockerfile.blueprint @@ -1,13 +1,14 @@ +{{- $php_version := .Orbit.php_version -}} {{- $variant := .Orbit.variant -}} +{{- $node_version := .Orbit.node_version -}} ARG INSTALL_CRON=1 ARG INSTALL_COMPOSER=1 -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-slim-{{ $variant }} +FROM thecodingmachine/php:{{ $php_version }}-v2-slim-{{ $variant }}{{if .Orbit.node_version }}-node{{ $node_version }}{{end}} LABEL authors="Julien Neuhart , David Négrier " + # |-------------------------------------------------------------------------- # | Main PHP extensions # |-------------------------------------------------------------------------- @@ -20,11 +21,14 @@ RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all. USER docker # |-------------------------------------------------------------------------- -# | Default PHP extensions to be enabled (in addition to the one declared in Slim build) +# | Default PHP extensions to be enabled # |-------------------------------------------------------------------------- ENV PHP_EXTENSION_APCU=1 \ PHP_EXTENSION_MYSQLI=1 \ + PHP_EXTENSION_OPCACHE=1 \ + PHP_EXTENSION_PDO=1 \ PHP_EXTENSION_PDO_MYSQL=1 \ - PHP_EXTENSION_IGBINARY=1 \ PHP_EXTENSION_REDIS=1 \ + PHP_EXTENSION_ZIP=1 \ PHP_EXTENSION_SOAP=1 + diff --git a/utils/Dockerfile.node.blueprint b/utils/Dockerfile.node.blueprint index 662b752f..1c8a6fae 100644 --- a/utils/Dockerfile.node.blueprint +++ b/utils/Dockerfile.node.blueprint @@ -1,9 +1,8 @@ +{{- $php_version := .Orbit.php_version -}} {{- $variant := .Orbit.variant -}} {{- $node_version := .Orbit.node_version -}} -ARG PHP_VERSION -ARG GLOBAL_VERSION -FROM thecodingmachine/php:${PHP_VERSION}-${GLOBAL_VERSION}-{{ $variant }} +FROM thecodingmachine/php:{{ $php_version }}-v2-{{ $variant }} LABEL authors="Julien Neuhart , David Négrier " diff --git a/utils/Dockerfile.slim.blueprint b/utils/Dockerfile.slim.blueprint index a968f8ef..b276b8d5 100644 --- a/utils/Dockerfile.slim.blueprint +++ b/utils/Dockerfile.slim.blueprint @@ -1,17 +1,10 @@ +{{- $php_version := .Orbit.php_version -}} {{- $variant := .Orbit.variant -}} -FROM ubuntu:bionic +FROM php:{{ $php_version }}-{{ $variant }}-stretch LABEL authors="Julien Neuhart , David Négrier " -# Fixes some weird terminal issues such as broken clear / CTRL+L -#ENV TERM=linux - -# Ensure apt doesn't ask questions when installing stuff -ENV DEBIAN_FRONTEND=noninteractive - -ARG PHP_VERSION -ENV PHP_VERSION=$PHP_VERSION # |-------------------------------------------------------------------------- # | Main PHP extensions @@ -20,32 +13,13 @@ ENV PHP_VERSION=$PHP_VERSION # | Installs the main PHP extensions # | -# Install php an other packages -RUN apt-get update \ - && apt-get install -y --no-install-recommends gnupg \ - && echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - git \ - nano \ - sudo \ - iproute2 \ - openssh-client \ - procps \ - unzip \ - ca-certificates \ - curl \ - php${PHP_VERSION}-cli \ - php${PHP_VERSION}-curl \ - php${PHP_VERSION}-json \ - php${PHP_VERSION}-mbstring \ - php${PHP_VERSION}-opcache \ - php${PHP_VERSION}-readline \ - php${PHP_VERSION}-xml \ - php${PHP_VERSION}-zip \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* +COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions +RUN ln -s {{ $php_version }} /usr/local/lib/thecodingmachine-php/extensions/current + +# Install php extensions +RUN apt-get update && apt-get install -y --no-install-recommends git nano sudo iproute2 openssh-client procps unzip +RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/zip && ./install.sh +# RUN echo 'extension=zip.so' > /usr/local/etc/php/conf.d/generated_conf.ini # |-------------------------------------------------------------------------- # | User @@ -65,16 +39,11 @@ RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers # | Let's download php.ini for prod and development # | -#ADD https://raw.githubusercontent.com/php/php-src/PHP-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production -#ADD https://raw.githubusercontent.com/php/php-src/PHP-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development -#RUN chmod 644 /usr/local/etc/php/php.ini-* - +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-production /usr/local/etc/php/php.ini-production +ADD https://raw.githubusercontent.com/php/php-src/php-${PHP_VERSION}/php.ini-development /usr/local/etc/php/php.ini-development +RUN chmod 644 /usr/local/etc/php/php.ini-* ENV TEMPLATE_PHP_INI=development -# Let's remove the default php.ini file (it will be copied from TEMPLATE_PHP_INI) -RUN rm /etc/php/${PHP_VERSION}/cli/php.ini - - # |-------------------------------------------------------------------------- # | Composer # |-------------------------------------------------------------------------- @@ -91,41 +60,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local COPY utils/utils.php /usr/local/bin/utils.php COPY utils/composer_proxy.sh /usr/local/bin/composer COPY utils/generate_conf.php /usr/local/bin/generate_conf.php -COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php -# |-------------------------------------------------------------------------- -# | Default PHP extensions to be enabled -# | By default, enable all the extensions that are enabled on a base Ubuntu install -# |-------------------------------------------------------------------------- -ENV PHP_EXTENSION_CALENDAR=1 \ - PHP_EXTENSION_CTYPE=1 \ - PHP_EXTENSION_CURL=1 \ - PHP_EXTENSION_DOM=1 \ - PHP_EXTENSION_EXIF=1 \ - PHP_EXTENSION_FILEINFO=1 \ - PHP_EXTENSION_FTP=1 \ - PHP_EXTENSION_GETTEXT=1 \ - PHP_EXTENSION_ICONV=1 \ - PHP_EXTENSION_JSON=1 \ - PHP_EXTENSION_MBSTRING=1 \ - PHP_EXTENSION_OPCACHE=1 \ - PHP_EXTENSION_PDO=1 \ - PHP_EXTENSION_PHAR=1 \ - PHP_EXTENSION_POSIX=1 \ - PHP_EXTENSION_READLINE=1 \ - PHP_EXTENSION_SHMOP=1 \ - PHP_EXTENSION_SIMPLEXML=1 \ - PHP_EXTENSION_SOCKETS=1 \ - PHP_EXTENSION_SYSVMSG=1 \ - PHP_EXTENSION_SYSVSEM=1 \ - PHP_EXTENSION_SYSVSHM=1 \ - PHP_EXTENSION_TOKENIZER=1 \ - PHP_EXTENSION_WDDX=1 \ - PHP_EXTENSION_XML=1 \ - PHP_EXTENSION_XMLREADER=1 \ - PHP_EXTENSION_XMLWRITER=1 \ - PHP_EXTENSION_XSL=1 \ - PHP_EXTENSION_ZIP=1 # |-------------------------------------------------------------------------- # | prestissimo @@ -137,21 +72,15 @@ ENV PHP_EXTENSION_CALENDAR=1 \ USER docker RUN composer global require hirak/prestissimo && \ composer global require bamarni/symfony-console-autocomplete && \ - rm -rf ~/.composer + rm -rf $HOME\.composer USER root {{if eq $variant "apache" }} -ENV APACHE_DOCUMENT_ROOT= - -RUN apt-get update \ - && apt-get install -y --no-install-recommends apache2 \ - libapache2-mod-php${PHP_VERSION} \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* +ENV APACHE_DOCUMENT_ROOT / -RUN sed -ri -e 's!/var/www/html!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf -RUN sed -ri -e 's!/var/www/!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf +RUN sed -ri -e 's!/var/www/html!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!/var/www/html/${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf # |-------------------------------------------------------------------------- # | Apache mod_rewrite @@ -163,24 +92,12 @@ RUN sed -ri -e 's!/var/www/!${ABSOLUTE_APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apa RUN a2enmod rewrite {{end}} -{{if eq $variant "fpm" }} -RUN apt-get update \ - && apt-get install -y --no-install-recommends php${PHP_VERSION}-fpm \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* -{{end}} - - {{if eq $variant "cli" }} RUN mkdir -p /usr/src/app && chown docker:docker /usr/src/app WORKDIR /usr/src/app {{end}} -{{if eq $variant "fpm" }} -RUN mkdir -p /var/www/html && chown -R docker: /var/www -{{end}} {{if or (eq $variant "apache") (eq $variant "fpm") }} RUN chown docker:docker /var/www/html -WORKDIR /var/www/html {{end}} # |-------------------------------------------------------------------------- @@ -240,7 +157,7 @@ RUN sed -i 's#/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin#/usr/ ENV IMAGE_VARIANT={{$variant}} -# Add Tini (to be able to stop the container with ctrl-c). +# Add Tini (to be able to stop the container with ctrl-c. # See: https://github.com/krallin/tini ENV TINI_VERSION v0.16.1 ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini @@ -255,9 +172,6 @@ COPY utils/apache-expose-envvars.sh /usr/local/bin/apache-expose-envvars.sh COPY utils/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh COPY utils/docker-entrypoint-as-root.sh /usr/local/bin/docker-entrypoint-as-root.sh -COPY extensions/ /usr/local/lib/thecodingmachine-php/extensions -RUN ln -s ${PHP_VERSION} /usr/local/lib/thecodingmachine-php/extensions/current - ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] {{if eq $variant "apache" }} @@ -286,16 +200,13 @@ CMD ["php", "-v"] CMD ["php-fpm"] {{end}} -RUN touch /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini && ln -s /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini /etc/php/${PHP_VERSION}/cli/conf.d/generated_conf.ini - USER docker COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php -COPY utils/install_selected_extensions.sh /usr/local/bin/install_selected_extensions.sh ONBUILD ARG PHP_EXTENSIONS ONBUILD ENV PHP_EXTENSIONS="$PHP_EXTENSIONS" -ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" /usr/local/bin/install_selected_extensions.sh +ONBUILD RUN sudo -E PHP_EXTENSIONS="$PHP_EXTENSIONS" php /usr/local/bin/install_selected_extensions.php # |-------------------------------------------------------------------------- # | Supercronic diff --git a/utils/README.blueprint.md b/utils/README.blueprint.md index 602fce51..62f193c9 100644 --- a/utils/README.blueprint.md +++ b/utils/README.blueprint.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/thecodingmachine/docker-images-php.svg?branch=v3)](https://travis-ci.org/thecodingmachine/docker-images-php) +[![Build Status](https://travis-ci.org/thecodingmachine/docker-images-php.svg?branch=v2)](https://travis-ci.org/thecodingmachine/docker-images-php) # General purpose PHP images for Docker @@ -16,25 +16,25 @@ This repository contains a set of developer-friendly, general purpose PHP images {{ $image := .Orbit.Images }} ## Images -{{ $versions := list "7.4" "7.3" "7.2" "7.1" }} +{{ $versions := list "7.3" "7.2" "7.1" }} | Name | PHP version | type |variant | NodeJS version | Size |-------------------------------------------------------------------------|------------------------------|------|--------|-----------------|------ -{{range $versions}}| [thecodingmachine/php:{{ . }}-v3-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.apache) | `{{ . }}.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-apache.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-apache) -| [thecodingmachine/php:{{ . }}-v3-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.apache.node8) | `{{ . }}.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-apache-node8) -| [thecodingmachine/php:{{ . }}-v3-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.apache.node10) | `{{ . }}.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-apache-node10) -| [thecodingmachine/php:{{ . }}-v3-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.apache.node12) | `{{ . }}.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-apache-node12) -| [thecodingmachine/php:{{ . }}-v3-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.fpm) | `{{ . }}.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-fpm) -| [thecodingmachine/php:{{ . }}-v3-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.fpm.node8) | `{{ . }}.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-fpm-node8) -| [thecodingmachine/php:{{ . }}-v3-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.fpm.node10) | `{{ . }}.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-fpm-node10) -| [thecodingmachine/php:{{ . }}-v3-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.fpm.node12) | `{{ . }}.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-fpm-node12) -| [thecodingmachine/php:{{ . }}-v3-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.cli) | `{{ . }}.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-cli.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-cli) -| [thecodingmachine/php:{{ . }}-v3-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.cli.node8) | `{{ . }}.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-cli-node8) -| [thecodingmachine/php:{{ . }}-v3-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.cli.node10) | `{{ . }}.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-cli-node10) -| [thecodingmachine/php:{{ . }}-v3-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.cli.node12) | `{{ . }}.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-cli-node12) -| [thecodingmachine/php:{{ . }}-v3-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.slim.apache) | `{{ . }}.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-slim-apache) -| [thecodingmachine/php:{{ . }}-v3-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.slim.fpm) | `{{ . }}.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-slim-fpm) -| [thecodingmachine/php:{{ . }}-v3-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v3/Dockerfile.{{ . }}.slim.cli) | `{{ . }}.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v3-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v3-slim-cli) +{{range $versions}}| [thecodingmachine/php:{{ . }}-v2-apache](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.apache) | `{{ . }}.x` | fat | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-apache.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-apache) +| [thecodingmachine/php:{{ . }}-v2-apache-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.apache.node8) | `{{ . }}.x` | fat | apache | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-apache-node8.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-apache-node8) +| [thecodingmachine/php:{{ . }}-v2-apache-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.apache.node10) | `{{ . }}.x` | fat | apache | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-apache-node10.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-apache-node10) +| [thecodingmachine/php:{{ . }}-v2-apache-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.apache.node12) | `{{ . }}.x` | fat | apache | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-apache-node12.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-apache-node12) +| [thecodingmachine/php:{{ . }}-v2-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.fpm) | `{{ . }}.x` | fat | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-fpm) +| [thecodingmachine/php:{{ . }}-v2-fpm-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.fpm.node8) | `{{ . }}.x` | fat | fpm | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-fpm-node8.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-fpm-node8) +| [thecodingmachine/php:{{ . }}-v2-fpm-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.fpm.node10) | `{{ . }}.x` | fat | fpm | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-fpm-node10.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-fpm-node10) +| [thecodingmachine/php:{{ . }}-v2-fpm-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.fpm.node12) | `{{ . }}.x` | fat | fpm | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-fpm-node12.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-fpm-node12) +| [thecodingmachine/php:{{ . }}-v2-cli](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.cli) | `{{ . }}.x` | fat | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-cli.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-cli) +| [thecodingmachine/php:{{ . }}-v2-cli-node8](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.cli.node8) | `{{ . }}.x` | fat | cli | `8.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-cli-node8.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-cli-node8) +| [thecodingmachine/php:{{ . }}-v2-cli-node10](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.cli.node10) | `{{ . }}.x` | fat | cli | `10.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-cli-node10.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-cli-node10) +| [thecodingmachine/php:{{ . }}-v2-cli-node12](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.cli.node12) | `{{ . }}.x` | fat | cli | `12.x` | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-cli-node12.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-cli-node12) +| [thecodingmachine/php:{{ . }}-v2-slim-apache](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.slim.apache) | `{{ . }}.x` | slim | apache | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-slim-apache.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-slim-apache) +| [thecodingmachine/php:{{ . }}-v2-slim-fpm](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.slim.fpm) | `{{ . }}.x` | slim | fpm | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-slim-fpm.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-slim-fpm) +| [thecodingmachine/php:{{ . }}-v2-slim-cli](https://github.com/thecodingmachine/docker-images-php/blob/v2/Dockerfile.{{ . }}.slim.cli) | `{{ . }}.x` | slim | cli | *N/A* | [![](https://images.microbadger.com/badges/image/thecodingmachine/php:{{ . }}-v2-slim-cli.svg)](https://microbadger.com/images/thecodingmachine/php:{{ . }}-v2-slim-cli) {{end}} Note: we do not tag patch releases of PHP, only minor versions. You will find one image for PHP 7.1, one for PHP 7.2, @@ -43,7 +43,7 @@ When 7.1.13 is out, you certainly want to upgrade automatically to this patch re Images are automatically updated when a new patch version of PHP is released, so the PHP 7.1 image will always contain the most up-to-date version of the PHP 7.1.x branch. If you want to automatically update your images on your production -environment, you can use tools like [watchtower](https://github.com/v3tec/watchtower) that will monitor new versions of +environment, you can use tools like [watchtower](https://github.com/v2tec/watchtower) that will monitor new versions of the images and update your environment on the fly. ## Usage @@ -53,26 +53,26 @@ These images are based on the [official PHP image](https://hub.docker.com/_/php/ Example with CLI: ```bash -$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app thecodingmachine/php:{{ $image.php_version }}-v3-cli php your-script.php +$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app thecodingmachine/php:{{ $image.php_version }}-v2-cli php your-script.php ``` Example with Apache: ```bash -$ docker run -p 80:80 --rm --name my-apache-php-app -v "$PWD":/var/www/html thecodingmachine/php:{{ $image.php_version }}-v3-apache +$ docker run -p 80:80 --rm --name my-apache-php-app -v "$PWD":/var/www/html thecodingmachine/php:{{ $image.php_version }}-v2-apache ``` Example with PHP-FPM: ```bash -$ docker run -p 9000:9000 --rm --name my-php-fpm -v "$PWD":/var/www/html thecodingmachine/{{ $image.php_version }}-v3-fpm +$ docker run -p 9000:9000 --rm --name my-php-fpm -v "$PWD":/var/www/html thecodingmachine/{{ $image.php_version }}-v2-fpm ``` Example with Apache + Node 8.x in a Dockerfile: **Dockerfile** ```Dockerfile -FROM thecodingmachine/php:{{ $image.php_version }}-v3-apache-node8 +FROM thecodingmachine/php:{{ $image.php_version }}-v2-apache-node8 COPY src/ /var/www/html/ RUN composer install @@ -84,28 +84,29 @@ RUN npm run build This image comes with 2 "types": the *slim* and the **fat** image. -The slim image contains only a set a base PHP extensions. - -Only these extensions are available in the slim image: `calendar ctype curl dom exif fileinfo ftp gettext iconv json mbstring opcache pdo phar posix readline shmop simplexml sockets sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl zip` - -The slim image provides a simple way to install the other extensions. You would typically use the "slim" +The slim image contains no extensions. But it provides a simple way to install them. You would typically use the "slim" image in a `Dockerfile` when building your own custom image. The fat image contains the most commonly used extensions. You would typically use it in a local or CI environment. +### Compiled extensions + +For both types, these extensions are **compiled in PHP** (cannot be disabled): {{ $image.compiled_php_extensions }} + ### Fat image Below is a list of extensions available in this image: -**Enabled by default (in addition to extensions enabled in Slim image):** apcu mysqli pdo_mysql igbinary redis soap +**Enabled by default:** {{ $image.enabled_php_extensions }} -**Available (can be enabled using environment variables):** amqp ast bcmath blackfire bz2 calendar dba ds enchant ev event exif mailparse msgpack gd gettext gmp gnupg igbinary imagick imap intl ldap mcrypt memcached mongodb pcntl pcov pdo_dblib pdo_pgsql pgsql pspell shmop snmp sockets swoole tidy weakref(-beta) xdebug xmlrpc xsl yaml +**Available (can be enabled using environment variables):** {{ $image.disabled_php_extensions }} -**Note**: as of 2019-11-28, PHP 7.4 has just been released and some extensions are not yet ready: +**Note**: as of 2018-12-13, PHP 7.3 has just been released and some extensions are not yet ready: -- *blackfire* extension is not compatible with PHP 7.4 yet -- *mcrypt* is not available anymore in PHP 7.3+ -- *weakref* is not compatible with PHP 7.3+ (but weak references were added to the PHP core in PHP 7.4) +- *amqp* extension is not compatible with PHP 7.3 yet +- *mcrypt* is not available anymore in PHP 7.3 +- *weakref* is not compatible with PHP 7.3 ([there might not be a version for PHP 7.3](https://wiki.php.net/rfc/weakrefs)) +- *xdebug* is provided in version 2.7.0beta1 ### Enabling/disabling extensions in the fat image @@ -117,7 +118,7 @@ For instance: version: '3' services: my_app: - image: thecodingmachine/php:{{ $image.php_version }}-v3-apache-node8 + image: thecodingmachine/php:{{ $image.php_version }}-v2-apache-node8 environment: # Enable the PostgreSQL extension PHP_EXTENSION_PGSQL: 1 @@ -128,7 +129,7 @@ services: As an alternative, you can use the `PHP_EXTENSIONS` global variable: ``` -PHP_EXTENSIONS=pgsql gettext imap +PHP_EXTENSIONS=pgsql gettext imap sockets ``` ### Compiling extensions in the slim image @@ -136,8 +137,8 @@ PHP_EXTENSIONS=pgsql gettext imap If you are using the slim image, you can automatically compile the extensions using the `PHP_EXTENSIONS` ARG in your Dockerfile. ```Dockerfile -ARG PHP_EXTENSIONS="apcu mysqli pdo_mysql redis soap" -FROM thecodingmachine/php:{{ $image.php_version }}-v3-slim-apache +ARG PHP_EXTENSIONS="apcu mysqli opcache pdo_mysql redis zip soap" +FROM thecodingmachine/php:{{ $image.php_version }}-v2-slim-apache # The build will automatically trigger the download and compilation # of the extensions (thanks to a ONBUILD hook in the slim image) ``` @@ -154,7 +155,7 @@ first FROM): # The PHP_EXTENSIONS ARG will apply to the "slim" image ARG PHP_EXTENSIONS="apcu mysqli opcache pdo_mysql zip soap" -FROM thecodingmachine/php:7.2-v3-apache-node10 AS builder +FROM thecodingmachine/php:7.2-v2-apache-node10 AS builder COPY --chown=docker:docker sources/web . RUN composer install &&\ @@ -162,10 +163,10 @@ RUN composer install &&\ yarn build # The slim image will automatically build the extensions from the list provided at the very top of the file. -FROM thecodingmachine/php:7.2-v3-slim-apache +FROM thecodingmachine/php:7.2-v2-slim-apache ENV APP_ENV=prod \ - APACHE_DOCUMENT_ROOT=public/ + APACHE_DOCUMENT_ROOT=/public COPY --from=builder /var/www/html . ``` @@ -190,7 +191,7 @@ You can override parameters in `php.ini` using the PHP_INI_XXX environment varia version: '3' services: my_app: - image: thecodingmachine/php:{{ $image.php_version }}-v3-apache-node8 + image: thecodingmachine/php:{{ $image.php_version }}-v2-apache-node8 environment: # set the parameter memory_limit=1g PHP_INI_MEMORY_LIMIT: 1g @@ -233,15 +234,6 @@ For the *apache* variant, you can change the document root of Apache (i.e. your APACHE_DOCUMENT_ROOT=public/ ``` -If the APACHE_DOCUMENT_ROOT starts with a "/", it will be considered an absolute path. -If the APACHE_DOCUMENT_ROOT does not starts with a "/", it will be a path relative to "/var/www/html". - -``` -# These 2 variables are identical -APACHE_DOCUMENT_ROOT=public/ -APACHE_DOCUMENT_ROOT=/var/www/html/public -``` - ## Enabling/disabling Apache extensions You can enable/disable Apache extensions using the `APACHE_EXTENSION_[extension_name]` environment variable. @@ -252,7 +244,7 @@ For instance: version: '3' services: my_app: - image: thecodingmachine/php:{{ $image.php_version }}-v3-apache-node8 + image: thecodingmachine/php:{{ $image.php_version }}-v2-apache-node8 environment: # Enable the DAV extension for Apache APACHE_EXTENSION_DAV: 1 @@ -295,7 +287,7 @@ If you use the *slim* images, you can install a NodeJS version with a simple ARG ```Dockerfile ARG NODE_VERSION=10 -FROM thecodingmachine/php:{{ $image.php_version }}-v3-slim-apache +FROM thecodingmachine/php:{{ $image.php_version }}-v2-slim-apache # The build will automatically trigger the download of Node 10 # (thanks to a ONBUILD hook in the slim image) ``` @@ -348,7 +340,7 @@ This can be done easily: **Dockerfile** ``` -FROM thecodingmachine/php:{{ $image.php_version }}-v3-apache +FROM thecodingmachine/php:{{ $image.php_version }}-v2-apache # ... @@ -392,7 +384,7 @@ a single argument before the "FROM" clause in your Dockerfile: ```Dockerfile ARG INSTALL_CRON=1 -FROM thecodingmachine/php:{{ $image.php_version }}-v3-slim-apache +FROM thecodingmachine/php:{{ $image.php_version }}-v2-slim-apache # The build triggers automatically the installation of Cron ``` @@ -430,12 +422,12 @@ If such a file is mounted in the image, it will be executed on container startup ```bash docker run -it --rm --name my-running-script -v "$PWD":/usr/src/myapp -w /usr/src/myapp \ - -v $PWD/my-startup-script.sh:/etc/container/startup.sh thecodingmachine/php:{{ $image.php_version }}-v3-cli php your-script.php + -v $PWD/my-startup-script.sh:/etc/container/startup.sh thecodingmachine/php:{{ $image.php_version }}-v2-cli php your-script.php ``` ## Using the CLI variant -The CLI images (thecodingmachine/php:7.x-v3-cli) expect a command to be passed in parameter. +The CLI images (thecodingmachine/php:7.x-v2-cli) expect a command to be passed in parameter. You should override the Docker "command". Important! You should not override the Docker "entrypoint". @@ -443,7 +435,7 @@ Important! You should not override the Docker "entrypoint". **Usage in a Dockerfile:** ```Dockerfile -FROM thecodingmachine/php:{{ $image.php_version }}-v3-cli +FROM thecodingmachine/php:{{ $image.php_version }}-v2-cli CMD ["php", "myprogram.php", "some_param"] ``` @@ -455,7 +447,7 @@ CMD ["php", "myprogram.php", "some_param"] version: '3' services: my_app: - image: thecodingmachine/php:{{ $image.php_version }}-v3-cli + image: thecodingmachine/php:{{ $image.php_version }}-v2-cli command: php myprogram.php some_param ``` @@ -475,7 +467,7 @@ This option is the easiest way to go if you are using the image on a development version: '3' services: my_app: - image: thecodingmachine/php:{{ $image.php_version }}-v3-apache-node8 + image: thecodingmachine/php:{{ $image.php_version }}-v2-apache-node8 volumes: - ~/.ssh:/home/docker/.ssh ``` @@ -496,7 +488,7 @@ Now, let's write a Dockerfile. **Dockerfile** ```yml -FROM thecodingmachine/php:{{ $image.php_version }}-v3-apache +FROM thecodingmachine/php:{{ $image.php_version }}-v2-apache ARG SSH_PRIVATE_KEY ARG SSH_KNOWN_HOSTS @@ -534,7 +526,7 @@ kind: Pod spec: containers: - name: foobar - image: thecodingmachine/php:{{ $image.php_version }}-v3-apache + image: thecodingmachine/php:{{ $image.php_version }}-v2-apache securityContext: allowPrivilegeEscalation: true # never use "false" here. ``` @@ -556,7 +548,7 @@ Your `docker-compose.yml` file will typically look like this: version: '3.3' services: php: - image: thecodingmachine/php:{{ $image.php_version }}-v3-apache + image: thecodingmachine/php:{{ $image.php_version }}-v2-apache ports: - "80:80" environment: @@ -582,7 +574,7 @@ If for some reason, the container name is not "blackfire", you can customize the version: '3.3' services: php: - image: thecodingmachine/php:{{ $image.php_version }}-v3-apache + image: thecodingmachine/php:{{ $image.php_version }}-v2-apache environment: PHP_EXTENSION_BLACKFIRE: 1 BLACKFIRE_AGENT: myblackfire @@ -613,7 +605,7 @@ This command will generate all the files from the "blueprint" templates. You can then test your changes using the `build-and-test.sh` command: ```bash -PHP_VERSION={{ $image.php_version }} BRANCH=v3 VARIANT=apache ./build-and-test.sh +PHP_VERSION={{ $image.php_version }} BRANCH=v2 VARIANT=apache ./build-and-test.sh ``` ### Adding additional images diff --git a/utils/composer_proxy.sh b/utils/composer_proxy.sh index 88323917..5f64ac8e 100755 --- a/utils/composer_proxy.sh +++ b/utils/composer_proxy.sh @@ -4,8 +4,7 @@ set -euo pipefail # We regenerate the configuration from environment variable, but only if the container is not started (i.e. if we are in a BUILD stage) if [ ! -f /opt/container_started ]; then - php /usr/local/bin/generate_conf.php | sudo tee /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini > /dev/null - php /usr/local/bin/setup_extensions.php | sudo bash + php /usr/local/bin/generate_conf.php | sudo tee /usr/local/etc/php/conf.d/generated_conf.ini > /dev/null fi real_composer "$@" diff --git a/utils/docker-entrypoint-as-root.sh b/utils/docker-entrypoint-as-root.sh index 1e3110be..33acaca3 100755 --- a/utils/docker-entrypoint-as-root.sh +++ b/utils/docker-entrypoint-as-root.sh @@ -6,10 +6,8 @@ set -e touch /opt/container_started # Let's apply the requested php.ini file - -# TODO: APACHE AND PHP-FPM -if [ ! -f /etc/php/${PHP_VERSION}/cli/php.ini ] || [ -L /etc/php/${PHP_VERSION}/cli/php.ini ]; then - ln -sf /usr/lib/php/${PHP_VERSION}/php.ini-${TEMPLATE_PHP_INI} /etc/php/${PHP_VERSION}/cli/php.ini +if [ ! -f /usr/local/etc/php/php.ini ] || [ -L /usr/local/etc/php/php.ini ]; then + ln -sf /usr/local/etc/php/php.ini-${TEMPLATE_PHP_INI} /usr/local/etc/php/php.ini fi # Let's find the user to use for commands. @@ -67,7 +65,6 @@ fi DOCKER_USER_ID=`id -ur $DOCKER_USER` #echo "Docker user id: $DOCKER_USER_ID" - # Fix access rights to stdout and stderr # Note: chown can fail on older versions of Docker (seen failing on Docker 17.06 on CentOS) set +e @@ -109,9 +106,7 @@ fi unset DOCKER_FOR_MAC_REMOTE_HOST unset REMOTE_HOST_FOUND -php /usr/local/bin/generate_conf.php > /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini -php /usr/local/bin/setup_extensions.php | sudo bash - +php /usr/local/bin/generate_conf.php > /usr/local/etc/php/conf.d/generated_conf.ini # output on the logs can be done by writing on the "tini" PID. Useful for CRONTAB TINI_PID=`ps -e | grep tini | awk '{print $1;}'` php /usr/local/bin/generate_cron.php $TINI_PID > /tmp/generated_crontab @@ -131,16 +126,10 @@ if [ -e /etc/container/startup.sh ]; then fi sudo -E -u "#$DOCKER_USER_ID" sh -c "php /usr/local/bin/startup_commands.php | bash" -if [[ "$APACHE_DOCUMENT_ROOT" == /* ]]; then - export ABSOLUTE_APACHE_DOCUMENT_ROOT="$APACHE_DOCUMENT_ROOT" -else - export ABSOLUTE_APACHE_DOCUMENT_ROOT="/var/www/html/$APACHE_DOCUMENT_ROOT" -fi - # We should run the command with the user of the directory... (unless this is Apache, that must run as root...) if [[ "$@" == "apache2-foreground" ]]; then /usr/local/bin/apache-expose-envvars.sh; - exec "/usr/sbin/apache2ctl" "-DFOREGROUND"; + exec "$@"; else exec "sudo" "-E" "-H" "-u" "#$DOCKER_USER_ID" "$@"; fi diff --git a/utils/enable_apache_mods.php b/utils/enable_apache_mods.php index 58b6fe38..3cb5fc64 100644 --- a/utils/enable_apache_mods.php +++ b/utils/enable_apache_mods.php @@ -3,9 +3,9 @@ * Enables or disables Apache extensions based on environment variables set. */ -$defaultExtensions = ['access_compat', 'alias', 'auth_basic', 'authn_core', 'authn_file', 'authz_core', 'authz_host', 'authz_user', 'autoindex', 'deflate', 'dir', 'env', 'expires', 'filter', 'mime', 'mpm_prefork', 'negotiation', 'php'.getenv('PHP_VERSION'), 'reqtimeout', 'rewrite', 'setenvif', 'status']; +$defaultExtensions = ['access_compat', 'alias', 'auth_basic', 'authn_core', 'authn_file', 'authz_core', 'authz_host', 'authz_user', 'autoindex', 'deflate', 'dir', 'env', 'expires', 'filter', 'mime', 'mpm_prefork', 'negotiation', 'php7', 'reqtimeout', 'rewrite', 'setenvif', 'status']; -$availableExtensions = ['access_compat', 'actions', 'alias', 'allowmethods', 'asis', 'auth_basic', 'auth_digest', 'auth_form', 'authn_anon', 'authn_core', 'authn_dbd', 'authn_dbm', 'authn_file', 'authn_socache', 'authnz_fcgi', 'authnz_ldap', 'authz_core', 'authz_dbd', 'authz_dbm', 'authz_groupfile', 'authz_host', 'authz_owner', 'authz_user', 'autoindex', 'buffer', 'cache', 'cache_disk', 'cache_socache', 'cgi', 'cgid', 'charset_lite', 'data', 'dav', 'dav_fs', 'dav_lock', 'dbd', 'deflate', 'dialup', 'dir', 'dump_io', 'echo', 'env', 'ext_filter', 'file_cache', 'filter', 'headers', 'heartbeat', 'heartmonitor', 'ident', 'include', 'info', 'lbmethod_bybusyness', 'lbmethod_byrequests', 'lbmethod_bytraffic', 'lbmethod_heartbeat', 'ldap', 'log_debug', 'log_forensic', 'lua', 'macro', 'mime', 'mime_magic', 'mpm_event', 'mpm_prefork', 'mpm_worker', 'negotiation', 'php'.getenv('PHP_VERSION'), 'proxy', 'proxy_ajp', 'proxy_balancer', 'proxy_connect', 'proxy_express', 'proxy_fcgi', 'proxy_fdpass', 'proxy_ftp', 'proxy_html', 'proxy_http', 'proxy_scgi', 'proxy_wstunnel', 'ratelimit', 'reflector', 'remoteip', 'reqtimeout', 'request', 'rewrite', 'sed', 'session', 'session_cookie', 'session_crypto', 'session_dbd', 'setenvif', 'slotmem_plain', 'slotmem_shm', 'socache_dbm', 'socache_memcache', 'socache_shmcb', 'speling', 'ssl', 'status', 'substitute', 'suexec', 'unique_id', 'userdir', 'usertrack', 'vhost_alias', 'xml2enc']; +$availableExtensions = ['access_compat', 'actions', 'alias', 'allowmethods', 'asis', 'auth_basic', 'auth_digest', 'auth_form', 'authn_anon', 'authn_core', 'authn_dbd', 'authn_dbm', 'authn_file', 'authn_socache', 'authnz_fcgi', 'authnz_ldap', 'authz_core', 'authz_dbd', 'authz_dbm', 'authz_groupfile', 'authz_host', 'authz_owner', 'authz_user', 'autoindex', 'buffer', 'cache', 'cache_disk', 'cache_socache', 'cgi', 'cgid', 'charset_lite', 'data', 'dav', 'dav_fs', 'dav_lock', 'dbd', 'deflate', 'dialup', 'dir', 'dump_io', 'echo', 'env', 'ext_filter', 'file_cache', 'filter', 'headers', 'heartbeat', 'heartmonitor', 'ident', 'include', 'info', 'lbmethod_bybusyness', 'lbmethod_byrequests', 'lbmethod_bytraffic', 'lbmethod_heartbeat', 'ldap', 'log_debug', 'log_forensic', 'lua', 'macro', 'mime', 'mime_magic', 'mpm_event', 'mpm_prefork', 'mpm_worker', 'negotiation', 'php7', 'proxy', 'proxy_ajp', 'proxy_balancer', 'proxy_connect', 'proxy_express', 'proxy_fcgi', 'proxy_fdpass', 'proxy_ftp', 'proxy_html', 'proxy_http', 'proxy_scgi', 'proxy_wstunnel', 'ratelimit', 'reflector', 'remoteip', 'reqtimeout', 'request', 'rewrite', 'sed', 'session', 'session_cookie', 'session_crypto', 'session_dbd', 'setenvif', 'slotmem_plain', 'slotmem_shm', 'socache_dbm', 'socache_memcache', 'socache_shmcb', 'speling', 'ssl', 'status', 'substitute', 'suexec', 'unique_id', 'userdir', 'usertrack', 'vhost_alias', 'xml2enc']; $delimiter = [',', '|', ';', ':']; $replace = str_replace($delimiter, ' ', getenv('APACHE_EXTENSIONS')); diff --git a/utils/generate_conf.php b/utils/generate_conf.php index 73db11c5..e40e6f3e 100644 --- a/utils/generate_conf.php +++ b/utils/generate_conf.php @@ -6,6 +6,69 @@ require 'utils.php'; +$compiledExtensions = [ + 'ftp', 'mysqlnd', 'mbstring' +]; + +$availableExtensions = getAvailableExtensions(); + +$phpExtensions = getPhpExtensionsEnvVar(); + +foreach ($compiledExtensions as $phpExtension) { + $envName = 'PHP_EXTENSION_'.strtoupper($phpExtension); + + $env = strtolower(trim(getenv($envName))); + + if ($env === '0' || $env === 'false' || $env === 'no' || $env === 'off') { + file_put_contents('php://stderr', "You cannot disable extension '$phpExtension'. It is compiled in the PHP binary.\n"); + exit(1); + } + if (enableExtension($phpExtension)) { + file_put_contents('php://stderr', "You cannot explicitly enable extension '$phpExtension'. It is compiled in the PHP binary and therefore always available.\n"); + exit(1); + } +} + +// Validate the content of PHP_EXTENSIONS +foreach ($phpExtensions as $phpExtension) { + if (!in_array($phpExtension, $availableExtensions, true)) { + file_put_contents('php://stderr', "Invalid extension name found in PHP_EXTENSIONS environment variable. Found: '$phpExtension'. Available extensions: ".implode(', ', $availableExtensions).".\n"); + exit(1); + } +} + +if (enableExtension('xdebug') && enableExtension('blackfire')) { + error_log('WARNING: Both Blackfire and Xdebug are enabled. This is not recommended as the PHP engine may not behave as expected. You should strongly consider disabling Xdebug or Blackfire.'); +} + +foreach ($availableExtensions as $extension) { + if (enableExtension($extension)) { + if ($extension === 'xdebug') { + echo "zend_extension=xdebug.so\n"; + echo "xdebug.remote_host=".getenv('XDEBUG_REMOTE_HOST')."\n"; + echo "xdebug.remote_enable=on\n"; + //echo "xdebug.remote_autostart=off\n"; + //echo "xdebug.remote_port=9000\n"; + //echo "xdebug.remote_connect_back=0\n"; + } elseif ($extension === 'blackfire') { + $blackFireAgent = getenv('BLACKFIRE_AGENT'); + if (!$blackFireAgent) { + $blackFireAgent = 'blackfire'; + } + echo "extension=blackfire.so\n"; + echo "blackfire.agent_socket=tcp://$blackFireAgent:8707\n"; + } elseif ($extension === 'opcache') { + echo "zend_extension=opcache.so\n"; + } elseif ($extension === 'event' && !enableExtension('sockets')) { + // Event extension depends on Sockets extension + echo "extension=sockets.so\n"; + echo "extension=event.so\n"; + } else { + echo "extension=$extension.so\n"; + } + } +} + // Reading environment variables from $_SERVER (because $_ENV is not necessarily populated, depending on variables_order directive): foreach ($_SERVER as $key => $value) { @@ -19,20 +82,3 @@ echo "$iniParam=$value\n"; } } - -if (enableExtension('xdebug')) { - //echo "zend_extension=xdebug.so\n"; - echo "xdebug.remote_host=".getenv('XDEBUG_REMOTE_HOST')."\n"; - echo "xdebug.remote_enable=on\n"; - //echo "xdebug.remote_autostart=off\n"; - //echo "xdebug.remote_port=9000\n"; - //echo "xdebug.remote_connect_back=0\n"; -} -if (enableExtension('blackfire')) { - $blackFireAgent = getenv('BLACKFIRE_AGENT'); - if (!$blackFireAgent) { - $blackFireAgent = 'blackfire'; - } - //echo "extension=blackfire.so\n"; - echo "blackfire.agent_socket=tcp://$blackFireAgent:8707\n"; -} diff --git a/utils/install_selected_extensions.sh b/utils/install_selected_extensions.sh deleted file mode 100755 index f43c4efa..00000000 --- a/utils/install_selected_extensions.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -set -e -set -x - -# Let's disable autoclean of package list after apt-get install -mv /etc/apt/apt.conf.d/docker-clean /tmp/docker-clean - -apt-get update - -php /usr/local/bin/install_selected_extensions.php - -# Let's enable autoclean again -mv /tmp/docker-clean /etc/apt/apt.conf.d/docker-clean - -apt-get purge -y php-pear build-essential php${PHP_VERSION}-dev pkg-config -apt-get autoremove -y -apt-get clean -rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* diff --git a/utils/setup_extensions.php b/utils/setup_extensions.php deleted file mode 100755 index 158b96b7..00000000 --- a/utils/setup_extensions.php +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/php -