Loading Dockerfile +22 −15 Changes for Dockerfile: 22 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -10,26 +10,26 @@ FROM debian:stretch LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>" ARG PHP_VERSION ARG HTTP_PROXY ARG OCI8_PACKAGE #ARG http_proxy ENV PHP_VERSION=${PHP_VERSION} \ APACHE_CONF_DIR=/etc/apache2 \ PHP_CONF_DIR=/etc/php/${PHP_VERSION} \ HTTP_PROXY=${HTTP_PROXY} PHP_CONF_DIR=/etc/php/${PHP_VERSION} # Mise à niveau de la distrib RUN echo "Acquire::http::proxy \"${HTTP_PROXY}\";" > /etc/apt/apt.conf.d/proxy RUN apt-get -qq update RUN echo "Acquire::http::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf.d/proxy && \ echo "Acquire::https::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf.d/proxy && \ apt-get -qq update # PHP 7.x PPA repository # Repositories fournissant PHP 5.x et 7.x RUN apt-get install -y wget lsb-release apt-transport-https ca-certificates && \ echo "http_proxy = ${HTTP_PROXY}" >> /etc/wgetrc && \ echo "https_proxy = ${HTTP_PROXY}" >> /etc/wgetrc && \ echo "http_proxy = ${http_proxy}" >> /etc/wgetrc && \ echo "https_proxy = ${http_proxy}" >> /etc/wgetrc && \ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list # Installation des packages requis. # Installation des packages communs RUN apt-get -qq update && \ apt-get install -y \ apache2 \ Loading Loading @@ -74,6 +74,11 @@ RUN apt-get -qq update && \ php${PHP_VERSION}-xdebug \ php${PHP_VERSION}-xml \ php${PHP_VERSION}-zip \ php${PHP_VERSION}-cli \ php${PHP_VERSION}-common \ php${PHP_VERSION}-json \ php${PHP_VERSION}-opcache \ php${PHP_VERSION}-readline \ ssh \ ssl-cert \ subversion \ Loading @@ -82,12 +87,15 @@ RUN apt-get -qq update && \ wget \ zlib1g-dev # Config PHP. # Forçage de la version de PHP CLI RUN update-alternatives --set php /usr/bin/php${PHP_VERSION} # Config PHP ADD configs/php.conf ${PHP_CONF_DIR}/fpm/conf.d/20-php-unicaen.ini ADD configs/php-opcache.ini ${PHP_CONF_DIR}/fpm/conf.d/20-opcache-unicaen.ini # Package PHP Oracle OCI8 RUN pear config-set http_proxy ${HTTP_PROXY} RUN pear config-set http_proxy "${http_proxy}" ADD resources/instantclient-basiclite-linux.x64-12.2.0.1.0.zip /tmp/ ADD resources/instantclient-sdk-linux.x64-12.2.0.1.0.zip /tmp/ ADD resources/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip /tmp/ Loading @@ -102,20 +110,19 @@ RUN unzip -o /tmp/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -d /usr/local echo "extension=oci8.so" > ${PHP_CONF_DIR}/cli/conf.d/30-php-oci8.ini && \ echo "/usr/local/instantclient" > /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig # Apache RUN a2enmod actions alias rewrite ssl proxy proxy_fcgi setenvif headers && \ a2dismod mpm_event && a2enmod mpm_worker # Config Apache. ADD configs/apache/security.conf ${APACHE_CONF_DIR}/conf-available/security-unicaen.conf RUN a2disconf security.conf && \ a2enconf security-unicaen.conf a2enconf security-unicaen.conf php${PHP_VERSION}-fpm # Scripts maison ADD scripts/update-satis.sh /usr/local/bin/update-satis RUN chmod 755 /usr/local/bin/update-satis # Composer RUN curl -sS https://getcomposer.org/installer --proxy ${HTTP_PROXY} | php -- --install-dir=/usr/local/bin --filename=composer && \ RUN curl -sS https://getcomposer.org/installer --proxy "${http_proxy}" | php -- --install-dir=/usr/local/bin --filename=composer && \ composer global require hirak/prestissimo --no-plugins --no-scripts # Nettoyage Loading README.md +20 −17 Changes for README.md: 20 added lines, 17 removed lines. Original line number Diff line number Diff line Loading @@ -17,12 +17,10 @@ Construisez l'image pour la version de PHP désirée, pour l'ajouter au registre ### PHP 5.6 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ PHP_VERSION=5.6 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8-2.0.12" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -32,13 +30,10 @@ docker build \ ### PHP 7.0 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.0 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -48,13 +43,10 @@ docker build \ ### PHP 7.1 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.1 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -64,13 +56,10 @@ docker build \ ### PHP 7.2 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.2 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -80,13 +69,10 @@ docker build \ ### PHP 7.3 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.3 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -96,19 +82,36 @@ docker build \ ### PHP 7.4 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.4 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ . ``` ### Proxy Si vous êtes derrière un proxy, passez les variables `*_proxy` à la commande `build` avec `--build-arg`. Exemple : ```bash PHP_VERSION=7.4 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg OCI8_PACKAGE="oci8" \ --build-arg http_proxy=http://proxy.unicaen.fr:3128 \ --build-arg https_proxy=http://proxy.unicaen.fr:3128 \ --build-arg no_proxy=*.unicaen.fr \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ . ``` ## Utilisation de l'image ### Dans un `Dockerfile` Loading Loading
Dockerfile +22 −15 Changes for Dockerfile: 22 added lines, 15 removed lines. Original line number Diff line number Diff line Loading @@ -10,26 +10,26 @@ FROM debian:stretch LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>" ARG PHP_VERSION ARG HTTP_PROXY ARG OCI8_PACKAGE #ARG http_proxy ENV PHP_VERSION=${PHP_VERSION} \ APACHE_CONF_DIR=/etc/apache2 \ PHP_CONF_DIR=/etc/php/${PHP_VERSION} \ HTTP_PROXY=${HTTP_PROXY} PHP_CONF_DIR=/etc/php/${PHP_VERSION} # Mise à niveau de la distrib RUN echo "Acquire::http::proxy \"${HTTP_PROXY}\";" > /etc/apt/apt.conf.d/proxy RUN apt-get -qq update RUN echo "Acquire::http::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf.d/proxy && \ echo "Acquire::https::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf.d/proxy && \ apt-get -qq update # PHP 7.x PPA repository # Repositories fournissant PHP 5.x et 7.x RUN apt-get install -y wget lsb-release apt-transport-https ca-certificates && \ echo "http_proxy = ${HTTP_PROXY}" >> /etc/wgetrc && \ echo "https_proxy = ${HTTP_PROXY}" >> /etc/wgetrc && \ echo "http_proxy = ${http_proxy}" >> /etc/wgetrc && \ echo "https_proxy = ${http_proxy}" >> /etc/wgetrc && \ wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg && \ echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/php.list # Installation des packages requis. # Installation des packages communs RUN apt-get -qq update && \ apt-get install -y \ apache2 \ Loading Loading @@ -74,6 +74,11 @@ RUN apt-get -qq update && \ php${PHP_VERSION}-xdebug \ php${PHP_VERSION}-xml \ php${PHP_VERSION}-zip \ php${PHP_VERSION}-cli \ php${PHP_VERSION}-common \ php${PHP_VERSION}-json \ php${PHP_VERSION}-opcache \ php${PHP_VERSION}-readline \ ssh \ ssl-cert \ subversion \ Loading @@ -82,12 +87,15 @@ RUN apt-get -qq update && \ wget \ zlib1g-dev # Config PHP. # Forçage de la version de PHP CLI RUN update-alternatives --set php /usr/bin/php${PHP_VERSION} # Config PHP ADD configs/php.conf ${PHP_CONF_DIR}/fpm/conf.d/20-php-unicaen.ini ADD configs/php-opcache.ini ${PHP_CONF_DIR}/fpm/conf.d/20-opcache-unicaen.ini # Package PHP Oracle OCI8 RUN pear config-set http_proxy ${HTTP_PROXY} RUN pear config-set http_proxy "${http_proxy}" ADD resources/instantclient-basiclite-linux.x64-12.2.0.1.0.zip /tmp/ ADD resources/instantclient-sdk-linux.x64-12.2.0.1.0.zip /tmp/ ADD resources/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip /tmp/ Loading @@ -102,20 +110,19 @@ RUN unzip -o /tmp/instantclient-basiclite-linux.x64-12.2.0.1.0.zip -d /usr/local echo "extension=oci8.so" > ${PHP_CONF_DIR}/cli/conf.d/30-php-oci8.ini && \ echo "/usr/local/instantclient" > /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig # Apache RUN a2enmod actions alias rewrite ssl proxy proxy_fcgi setenvif headers && \ a2dismod mpm_event && a2enmod mpm_worker # Config Apache. ADD configs/apache/security.conf ${APACHE_CONF_DIR}/conf-available/security-unicaen.conf RUN a2disconf security.conf && \ a2enconf security-unicaen.conf a2enconf security-unicaen.conf php${PHP_VERSION}-fpm # Scripts maison ADD scripts/update-satis.sh /usr/local/bin/update-satis RUN chmod 755 /usr/local/bin/update-satis # Composer RUN curl -sS https://getcomposer.org/installer --proxy ${HTTP_PROXY} | php -- --install-dir=/usr/local/bin --filename=composer && \ RUN curl -sS https://getcomposer.org/installer --proxy "${http_proxy}" | php -- --install-dir=/usr/local/bin --filename=composer && \ composer global require hirak/prestissimo --no-plugins --no-scripts # Nettoyage Loading
README.md +20 −17 Changes for README.md: 20 added lines, 17 removed lines. Original line number Diff line number Diff line Loading @@ -17,12 +17,10 @@ Construisez l'image pour la version de PHP désirée, pour l'ajouter au registre ### PHP 5.6 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ PHP_VERSION=5.6 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8-2.0.12" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -32,13 +30,10 @@ docker build \ ### PHP 7.0 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.0 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -48,13 +43,10 @@ docker build \ ### PHP 7.1 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.1 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -64,13 +56,10 @@ docker build \ ### PHP 7.2 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.2 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -80,13 +69,10 @@ docker build \ ### PHP 7.3 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.3 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ Loading @@ -96,19 +82,36 @@ docker build \ ### PHP 7.4 ```bash HTTP_PROXY=http://proxy.unicaen.fr:3128 ; \ NO_PROXY=unicaen.fr ; \ PHP_VERSION=7.4 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg HTTP_PROXY=${HTTP_PROXY} \ --build-arg OCI8_PACKAGE="oci8" \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ . ``` ### Proxy Si vous êtes derrière un proxy, passez les variables `*_proxy` à la commande `build` avec `--build-arg`. Exemple : ```bash PHP_VERSION=7.4 ; \ docker build \ --rm \ --build-arg PHP_VERSION=${PHP_VERSION} \ --build-arg OCI8_PACKAGE="oci8" \ --build-arg http_proxy=http://proxy.unicaen.fr:3128 \ --build-arg https_proxy=http://proxy.unicaen.fr:3128 \ --build-arg no_proxy=*.unicaen.fr \ -f Dockerfile \ -t unicaen-dev-php${PHP_VERSION}-apache \ . ``` ## Utilisation de l'image ### Dans un `Dockerfile` Loading