Skip to content
Snippets Groups Projects
Commit 15e5bb93 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Un Dockerfile par version majeure de PHP car les versions du driver Oracle...

Un Dockerfile par version majeure de PHP car les versions du driver Oracle OCI8 et Instant Client diffèrent.
parent 466414db
No related branches found
No related tags found
No related merge requests found
Pipeline #8860 passed
......@@ -9,7 +9,7 @@ build5.6:
script:
- export HTTP_PROXY=http://10.14.128.99:3128
- export 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" -t unicaen-dev-php${PHP_VERSION}-apache .
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-5.x -t unicaen-dev-php${PHP_VERSION}-apache .
- docker tag unicaen-dev-php${PHP_VERSION}-apache registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker push registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
......@@ -18,7 +18,7 @@ build7.0:
script:
- export HTTP_PROXY=http://10.14.128.99:3128
- export PHP_VERSION=7.0
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -t unicaen-dev-php${PHP_VERSION}-apache .
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-7.x -t unicaen-dev-php${PHP_VERSION}-apache .
- docker tag unicaen-dev-php${PHP_VERSION}-apache registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker push registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
......@@ -27,7 +27,7 @@ build7.1:
script:
- export HTTP_PROXY=http://10.14.128.99:3128
- export PHP_VERSION=7.1
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -t unicaen-dev-php${PHP_VERSION}-apache .
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-7.x -t unicaen-dev-php${PHP_VERSION}-apache .
- docker tag unicaen-dev-php${PHP_VERSION}-apache registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker push registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
......@@ -36,7 +36,7 @@ build7.2:
script:
- export HTTP_PROXY=http://10.14.128.99:3128
- export PHP_VERSION=7.2
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -t unicaen-dev-php${PHP_VERSION}-apache .
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-7.x -t unicaen-dev-php${PHP_VERSION}-apache .
- docker tag unicaen-dev-php${PHP_VERSION}-apache registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker push registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
......@@ -45,10 +45,10 @@ build7.3:
script:
- export HTTP_PROXY=http://10.14.128.99:3128
- export PHP_VERSION=7.3
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -t unicaen-dev-php${PHP_VERSION}-apache .
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-7.x -t unicaen-dev-php${PHP_VERSION}-apache .
- docker tag unicaen-dev-php${PHP_VERSION}-apache registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker push registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -t open-source/docker/unicaen-image:php${PHP_VERSION} .
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-7.x -t open-source/docker/unicaen-image:php${PHP_VERSION} .
- docker tag open-source/docker/unicaen-image:php${PHP_VERSION} registre.unicaen.fr:5000/open-source/docker/unicaen-image:php${PHP_VERSION}
- docker push registre.unicaen.fr:5000/open-source/docker/unicaen-image:php${PHP_VERSION}
......@@ -57,9 +57,21 @@ build7.4:
script:
- export HTTP_PROXY=http://10.14.128.99:3128
- export PHP_VERSION=7.4
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -t unicaen-dev-php${PHP_VERSION}-apache .
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-7.x -t unicaen-dev-php${PHP_VERSION}-apache .
- docker tag unicaen-dev-php${PHP_VERSION}-apache registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker push registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -t open-source/docker/unicaen-image:php${PHP_VERSION} .
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-7.x -t open-source/docker/unicaen-image:php${PHP_VERSION} .
- docker tag open-source/docker/unicaen-image:php${PHP_VERSION} registre.unicaen.fr:5000/open-source/docker/unicaen-image:php${PHP_VERSION}
- docker push registre.unicaen.fr:5000/open-source/docker/unicaen-image:php${PHP_VERSION}
build8.0:
stage: build
script:
- export HTTP_PROXY=http://10.14.128.99:3128
- export PHP_VERSION=8.0
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-8.x -t unicaen-dev-php${PHP_VERSION}-apache .
- docker tag unicaen-dev-php${PHP_VERSION}-apache registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker push registre.unicaen.fr:5000/unicaen-dev-php${PHP_VERSION}-apache
- docker build --rm --build-arg PHP_VERSION=${PHP_VERSION} --build-arg HTTP_PROXY=${HTTP_PROXY} -f Dockerfile-8.x -t open-source/docker/unicaen-image:php${PHP_VERSION} .
- docker tag open-source/docker/unicaen-image:php${PHP_VERSION} registre.unicaen.fr:5000/open-source/docker/unicaen-image:php${PHP_VERSION}
- docker push registre.unicaen.fr:5000/open-source/docker/unicaen-image:php${PHP_VERSION}
# CHANGELOG
## 1.0.0
- Un Dockerfile par version majeure de PHP car les versions du driver Oracle OCI8 et Instant Client diffèrent.
......@@ -4,16 +4,15 @@
#
###########################################################################################
FROM debian:stretch
FROM debian:stretch as distrib
#FROM localhost:5000/stretch
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
ARG PHP_VERSION
ARG OCI8_PACKAGE
#ARG http_proxy
ENV PHP_VERSION=${PHP_VERSION} \
OCI8_PACKAGE="oci8-2.0.12" \
APACHE_CONF_DIR=/etc/apache2 \
PHP_CONF_DIR=/etc/php/${PHP_VERSION}
......@@ -29,6 +28,9 @@ RUN apt-get install -y wget lsb-release apt-transport-https ca-certificates && \
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
FROM distrib
# Installation des packages communs
RUN apt-get -qq update && \
apt-get install -y \
......@@ -117,9 +119,8 @@ ADD configs/apache/security.conf ${APACHE_CONF_DIR}/conf-available/security-unic
RUN a2disconf security.conf && \
a2enconf security-unicaen.conf php${PHP_VERSION}-fpm
# 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
# Composer 2.x (plus besoin de hirak/prestissimo depuis la 2.x)
RUN curl -sS https://getcomposer.org/installer --proxy "${http_proxy}" | php -- --install-dir=/usr/local/bin --filename=composer
# Nettoyage
RUN apt-get autoremove -y && apt-get clean && rm -rf /tmp/* /var/tmp/*
......
......@@ -19,6 +19,7 @@ EOF
################################################################################################################
export PHP_VERSION="$1"
export OCI8_PACKAGE="oci8-2.0.12"
export APACHE_CONF_DIR=/etc/apache2
export PHP_CONF_DIR=/etc/php/${PHP_VERSION}
......@@ -113,7 +114,7 @@ unzip -o /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -d /usr/local/ && \
ln -s /usr/local/instantclient_12_2 /usr/local/instantclient && \
ln -s /usr/local/instantclient/libclntsh.so.12.1 /usr/local/instantclient/libclntsh.so && \
ln -s /usr/local/instantclient/sqlplus /usr/local/bin/sqlplus && \
echo 'instantclient,/usr/local/instantclient' | pecl install oci8 && \
echo 'instantclient,/usr/local/instantclient' | pecl install ${OCI8_PACKAGE} && \
echo "extension=oci8.so" > ${PHP_CONF_DIR}/fpm/conf.d/30-php-oci8.ini && \
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
......@@ -124,9 +125,8 @@ cp configs/apache/security.conf ${APACHE_CONF_DIR}/conf-available/security-unica
a2disconf security.conf && \
a2enconf security-unicaen.conf php${PHP_VERSION}-fpm
# Composer
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
# Composer 2.x (plus besoin de hirak/prestissimo depuis la 2.x)
curl -sS https://getcomposer.org/installer --proxy "${http_proxy}" | php -- --install-dir=/usr/local/bin --filename=composer
# Nettoyage
apt autoremove -y && apt clean
......
......@@ -13,15 +13,15 @@
# --build-arg no_proxy
#
FROM debian:stretch
FROM debian:stretch as distrib
#FROM localhost:5000/stretch
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
ARG PHP_VERSION
ARG OCI8_PACKAGE
ENV PHP_VERSION=${PHP_VERSION} \
OCI8_PACKAGE="oci8-2.2.0" \
APACHE_CONF_DIR=/etc/apache2 \
PHP_CONF_DIR=/etc/php/${PHP_VERSION}
......@@ -37,6 +37,9 @@ RUN apt-get install -y wget lsb-release apt-transport-https ca-certificates && \
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
FROM distrib
# Installation des packages communs
RUN apt-get -qq update && \
apt-get install -y \
......@@ -124,9 +127,8 @@ ADD configs/apache/security.conf ${APACHE_CONF_DIR}/conf-available/security-unic
RUN a2disconf security.conf && \
a2enconf security-unicaen.conf php${PHP_VERSION}-fpm
# 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
# Composer 2.x (plus besoin de hirak/prestissimo depuis la 2.x)
RUN curl -sS https://getcomposer.org/installer --proxy "${http_proxy}" | php -- --install-dir=/usr/local/bin --filename=composer
# Nettoyage
RUN apt-get autoremove -y && apt-get clean && rm -rf /tmp/* /var/tmp/*
......
#!/usr/bin/env bash
################################################################################################################
#
# Script d'install d'un serveur, traduction du Dockerfile.
#
# PHP >= 7.0
#
################################################################################################################
usage() {
cat << EOF
Script d'install d'un serveur, traduction du Dockerfile.
Usage: $0 <version de PHP>
EOF
exit 0;
}
[[ -z "$1" ]] && usage
################################################################################################################
export PHP_VERSION="$1"
export OCI8_PACKAGE="oci8-2.2.0"
export APACHE_CONF_DIR=/etc/apache2
export PHP_CONF_DIR=/etc/php/${PHP_VERSION}
# Mise à niveau de la distrib
echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf.d/05proxy
echo "Acquire::https::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf.d/05proxy
apt -qq update && apt -y full-upgrade
# PHP 7.x PPA repository
apt install -y wget lsb-release apt-transport-https ca-certificates
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" > /etc/apt/sources.list.d/php.list
export http_proxy=${HTTP_PROXY}
export https_proxy=${HTTP_PROXY}
export ftp_proxy=${HTTP_PROXY}
export no_proxy=unicaen.fr
# Installation des packages requis.
apt -qq update && \
apt install -y \
apache2 \
ca-certificates \
curl \
ghostscript \
ghostscript-x \
git \
ldap-utils \
libaio1 \
libcurl4-openssl-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
libssl-dev \
libxml2-dev \
make \
memcached \
libmemcached-tools \
netcat-openbsd \
php-pear \
php${PHP_VERSION} \
php${PHP_VERSION}-bcmath \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-dev \
php${PHP_VERSION}-fpm \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-gettext \
php${PHP_VERSION}-iconv \
php${PHP_VERSION}-imagick \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-ldap \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-memcached \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-soap \
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 \
unzip \
vim \
wget \
zlib1g-dev
# Forçage de la version de PHP CLI
update-alternatives --set php /usr/bin/php${PHP_VERSION}
# Config PHP.
cp configs/php.conf ${PHP_CONF_DIR}/fpm/conf.d/20-php-unicaen.ini
cp configs/php-opcache.ini ${PHP_CONF_DIR}/fpm/conf.d/20-opcache-unicaen.ini
# Package PHP Oracle OCI8
cp resources/instantclient-basiclite-linux.x64-18.5.0.0.0dbru.zip /tmp/
cp resources/instantclient-sdk-linux.x64-18.5.0.0.0dbru.zip /tmp/
cp resources/instantclient-sqlplus-linux.x64-18.5.0.0.0dbru.zip /tmp/
unzip -o /tmp/instantclient-basiclite-linux.x64-18.5.0.0.0dbru.zip -d /usr/local/ && \
unzip -o /tmp/instantclient-sdk-linux.x64-18.5.0.0.0dbru.zip -d /usr/local/ && \
unzip -o /tmp/instantclient-sqlplus-linux.x64-18.5.0.0.0dbru.zip -d /usr/local/ && \
ln -sf /usr/local/instantclient_18_5 /usr/local/instantclient && \
ln -sf /usr/local/instantclient/sqlplus /usr/local/bin/sqlplus && \
echo 'instantclient,/usr/local/instantclient' | pecl install ${OCI8_PACKAGE} && \
echo "extension=oci8.so" > ${PHP_CONF_DIR}/fpm/conf.d/30-php-oci8.ini && \
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
a2enmod actions alias rewrite ssl proxy proxy_fcgi setenvif headers && \
a2dismod mpm_event mpm_prefork && a2enmod mpm_worker
cp configs/apache/security.conf ${APACHE_CONF_DIR}/conf-available/security-unicaen.conf
a2disconf security.conf && \
a2enconf security-unicaen.conf php${PHP_VERSION}-fpm
# Composer 2.x (plus besoin de hirak/prestissimo depuis la 2.x)
curl -sS https://getcomposer.org/installer --proxy "${http_proxy}" | php -- --install-dir=/usr/local/bin --filename=composer
# Nettoyage
apt autoremove -y && apt clean
# Copie les fichiers situés dans ./entrypoint.d dans le dossier /entrypoint.d de l'image.
# Les scripts exécutables parmi eux seront exécutés au démarrage du container (cf. entrypoint.sh).
# Attention : les noms de fichiers ne doivent être constitués que de lettres minuscules ou majuscules,
# de chiffres, de tirets bas (underscore) ou de tirets ; extension interdite, donc.
mkdir -p /entrypoint.d
cp entrypoint.d/* /entrypoint.d/
# Entry point
cp entrypoint.sh /sbin/entrypoint.sh
chmod 755 /sbin/entrypoint.sh
export WITHOUT_DOCKER=1
bash /sbin/entrypoint.sh
###########################################################################################
#
# Image Unicaen
#
# PHP >= 8.0
#
###########################################################################################
#
# NB: Transmission possible des éventuelles variables d'env `http_*` via `--build-arg` :
# --build-arg http_proxy
# --build-arg https_proxy
# --build-arg no_proxy
#
FROM debian:stretch as distrib
#FROM localhost:5000/stretch
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
ARG PHP_VERSION
ENV PHP_VERSION=${PHP_VERSION} \
OCI8_PACKAGE="oci8-3.0.0" \
APACHE_CONF_DIR=/etc/apache2 \
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 && \
echo "Acquire::https::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf.d/proxy && \
apt-get -qq update
# 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 && \
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
FROM distrib
# Installation des packages communs
RUN apt-get -qq update && \
apt-get install -y \
apache2 \
ca-certificates \
curl \
ghostscript \
ghostscript-x \
git \
ldap-utils \
libaio1 \
libcurl4-openssl-dev \
libfreetype6-dev \
libicu-dev \
libjpeg62-turbo-dev \
libldap2-dev \
libmcrypt-dev \
libmemcached-dev \
libssl-dev \
libxml2-dev \
make \
memcached \
libmemcached-tools \
netcat-openbsd \
php-pear \
php${PHP_VERSION} \
php${PHP_VERSION}-bcmath \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-dev \
php${PHP_VERSION}-fpm \
php${PHP_VERSION}-gd \
php${PHP_VERSION}-gettext \
php${PHP_VERSION}-iconv \
php${PHP_VERSION}-imagick \
php${PHP_VERSION}-intl \
php${PHP_VERSION}-ldap \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-memcached \
php${PHP_VERSION}-mysql \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-pgsql \
php${PHP_VERSION}-soap \
php${PHP_VERSION}-xdebug \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-zip \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-common \
# php${PHP_VERSION}-json \ # inutile en PHP 8 car absorbé par php-fpm notamment
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-readline \
ssh \
ssl-cert \
subversion \
unzip \
vim \
wget \
zlib1g-dev
# 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}"
ADD resources/instantclient-basiclite-linux.x64-18.5.0.0.0dbru.zip /tmp/
ADD resources/instantclient-sdk-linux.x64-18.5.0.0.0dbru.zip /tmp/
ADD resources/instantclient-sqlplus-linux.x64-18.5.0.0.0dbru.zip /tmp/
RUN unzip -o /tmp/instantclient-basiclite-linux.x64-18.5.0.0.0dbru.zip -d /usr/local/ && \
unzip -o /tmp/instantclient-sdk-linux.x64-18.5.0.0.0dbru.zip -d /usr/local/ && \
unzip -o /tmp/instantclient-sqlplus-linux.x64-18.5.0.0.0dbru.zip -d /usr/local/ && \
ln -s /usr/local/instantclient_18_5 /usr/local/instantclient && \
ln -s /usr/local/instantclient/sqlplus /usr/bin/sqlplus && \
echo 'instantclient,/usr/local/instantclient' | pecl install ${OCI8_PACKAGE} && \
echo "extension=oci8.so" > ${PHP_CONF_DIR}/fpm/conf.d/30-php-oci8.ini && \
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
ADD configs/apache/security.conf ${APACHE_CONF_DIR}/conf-available/security-unicaen.conf
RUN a2disconf security.conf && \
a2enconf security-unicaen.conf php${PHP_VERSION}-fpm
# Composer 2.x (plus besoin de hirak/prestissimo depuis la 2.x)
RUN curl -sS https://getcomposer.org/installer --proxy "${http_proxy}" | php -- --install-dir=/usr/local/bin --filename=composer
# Nettoyage
RUN apt-get autoremove -y && apt-get clean && rm -rf /tmp/* /var/tmp/*
# Copie les fichiers situés dans ./entrypoint.d dans le dossier /entrypoint.d de l'image.
# Les scripts exécutables parmi eux seront exécutés au démarrage du container (cf. entrypoint.sh).
# Attention : les noms de fichiers ne doivent être constitués que de lettres minuscules ou majuscules,
# de chiffres, de tirets bas (underscore) ou de tirets ; extension interdite, donc.
ADD entrypoint.d/* /entrypoint.d/
# Entry point
ADD entrypoint.sh /sbin/entrypoint.sh
RUN chmod 755 /sbin/entrypoint.sh
CMD ["/sbin/entrypoint.sh"]
......@@ -21,6 +21,7 @@ EOF
################################################################################################################
export PHP_VERSION="$1"
export OCI8_PACKAGE="oci8-3.0.0"
export APACHE_CONF_DIR=/etc/apache2
export PHP_CONF_DIR=/etc/php/${PHP_VERSION}
......@@ -114,7 +115,7 @@ unzip -o /tmp/instantclient-sdk-linux.x64-18.5.0.0.0dbru.zip -d /usr/local/ && \
unzip -o /tmp/instantclient-sqlplus-linux.x64-18.5.0.0.0dbru.zip -d /usr/local/ && \
ln -sf /usr/local/instantclient_18_5 /usr/local/instantclient && \
ln -sf /usr/local/instantclient/sqlplus /usr/local/bin/sqlplus && \
echo 'instantclient,/usr/local/instantclient' | pecl install oci8 && \
echo 'instantclient,/usr/local/instantclient' | pecl install ${OCI8_PACKAGE} && \
echo "extension=oci8.so" > ${PHP_CONF_DIR}/fpm/conf.d/30-php-oci8.ini && \
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
......@@ -125,9 +126,8 @@ cp configs/apache/security.conf ${APACHE_CONF_DIR}/conf-available/security-unica
a2disconf security.conf && \
a2enconf security-unicaen.conf php${PHP_VERSION}-fpm
# Composer
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
# Composer 2.x (plus besoin de hirak/prestissimo depuis la 2.x)
curl -sS https://getcomposer.org/installer --proxy "${http_proxy}" | php -- --install-dir=/usr/local/bin --filename=composer
# Nettoyage
apt autoremove -y && apt clean
......
......@@ -22,105 +22,50 @@ docker build \
--rm \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg OCI8_PACKAGE="oci8-2.0.12" \
-f Dockerfile \
-f Dockerfile-5.x \
-t unicaen-dev-php${PHP_VERSION}-apache \
.
```
Si vous êtes derrière un proxy, reportez-vous au paragraphe [Proxy](#Proxy).
*Si vous êtes derrière un proxy, reportez-vous au paragraphe [Proxy](#Proxy).*
### PHP 7.0
```bash
PHP_VERSION=7.0 ; \
docker build \
--rm \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg OCI8_PACKAGE="oci8" \
-f Dockerfile \
-t unicaen-dev-php${PHP_VERSION}-apache \
.
```
Si vous êtes derrière un proxy, reportez-vous au paragraphe [Proxy](#Proxy).
### PHP 7.1
```bash
PHP_VERSION=7.1 ; \
docker build \
--rm \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg OCI8_PACKAGE="oci8" \
-f Dockerfile \
-t unicaen-dev-php${PHP_VERSION}-apache \
.
```
Si vous êtes derrière un proxy, reportez-vous au paragraphe [Proxy](#Proxy).
### PHP 7.2
```bash
PHP_VERSION=7.2 ; \
docker build \
--rm \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg OCI8_PACKAGE="oci8" \
-f Dockerfile \
-t unicaen-dev-php${PHP_VERSION}-apache \
.
```
Si vous êtes derrière un proxy, reportez-vous au paragraphe [Proxy](#Proxy).
### PHP 7.3
### PHP 7.x
Exemple pour PHP 7.3 :
```bash
PHP_VERSION=7.3 ; \
docker build \
--rm \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg OCI8_PACKAGE="oci8" \
-f Dockerfile \
-f Dockerfile-7.x \
-t unicaen-dev-php${PHP_VERSION}-apache \
.
```
Si vous êtes derrière un proxy, reportez-vous au paragraphe [Proxy](#Proxy).
*Si vous êtes derrière un proxy, reportez-vous au paragraphe [Proxy](#Proxy).*
### PHP 7.4
### PHP 8.x
Exemple pour PHP 8.0 :
```bash
PHP_VERSION=7.4 ; \
PHP_VERSION=8.0 ; \
docker build \
--rm \
--build-arg PHP_VERSION=${PHP_VERSION} \
--build-arg OCI8_PACKAGE="oci8" \
-f Dockerfile \
-f Dockerfile-8.x \
-t unicaen-dev-php${PHP_VERSION}-apache \
.
```
Si vous êtes derrière un proxy, reportez-vous au paragraphe [Proxy](#Proxy).
### Proxy
Si vous êtes derrière un proxy, passez les variables `*_proxy` à la commande `build` avec `--build-arg`.
Si vous êtes derrière un proxy, passez les variables `*_proxy` à la commande `build` avec des `--build-arg` additionnels.
Exemple :
```bash
PHP_VERSION=7.3 ; \
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 \
.
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment