Added support for OCI8 extension in workspace and php-fpm containers. PHP 5.6, 7.0, 7.1, 7.2 and 7.3

This commit is contained in:
João Zonta 2019-09-11 23:54:29 -03:00
parent cb910c590e
commit 559acc278b
4 changed files with 90 additions and 0 deletions

View File

@ -83,6 +83,7 @@ services:
- INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI}
- INSTALL_DRUPAL_CONSOLE=${WORKSPACE_INSTALL_DRUPAL_CONSOLE}
- INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE}
- INSTALL_OCI8=${WORKSPACE_INSTALL_OCI8}
- INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS}
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
- COMPOSER_AUTH=${WORKSPACE_COMPOSER_AUTH}
@ -165,6 +166,7 @@ services:
- INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE}
- INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF}
- INSTALL_AEROSPIKE=${PHP_FPM_INSTALL_AEROSPIKE}
- INSTALL_OCI8=${PHP_FPM_INSTALL_OCI8}
- INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI}
- INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL}
- INSTALL_PG_CLIENT=${PHP_FPM_INSTALL_PG_CLIENT}

View File

@ -113,6 +113,7 @@ WORKSPACE_DRUSH_VERSION=8.1.17
WORKSPACE_INSTALL_DRUPAL_CONSOLE=false
WORKSPACE_INSTALL_WP_CLI=false
WORKSPACE_INSTALL_AEROSPIKE=false
WORKSPACE_INSTALL_OCI8=false
WORKSPACE_INSTALL_V8JS=false
WORKSPACE_INSTALL_LARAVEL_ENVOY=false
WORKSPACE_INSTALL_LARAVEL_INSTALLER=false
@ -170,6 +171,7 @@ PHP_FPM_INSTALL_XSL=false
PHP_FPM_INSTALL_GMP=false
PHP_FPM_INSTALL_EXIF=false
PHP_FPM_INSTALL_AEROSPIKE=false
PHP_FPM_INSTALL_OCI8=false
PHP_FPM_INSTALL_PGSQL=false
PHP_FPM_INSTALL_GHOSTSCRIPT=false
PHP_FPM_INSTALL_LDAP=false

View File

@ -423,6 +423,51 @@ RUN set -xe; \
&& docker-php-ext-enable aerospike \
;fi
###########################################################################
# PHP OCI8:
###########################################################################
ARG INSTALL_OCI8=false
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_12_1"
ENV OCI_HOME="/opt/oracle/instantclient_12_1"
ENV OCI_LIB_DIR="/opt/oracle/instantclient_12_1"
ENV OCI_INCLUDE_DIR="/opt/oracle/instantclient_12_1/sdk/include"
ENV OCI_VERSION=12
RUN if [ ${INSTALL_OCI8} = true ]; then \
# Install wget
apt-get update && apt-get install --no-install-recommends -y wget \
# Install Oracle Instantclient
&& mkdir /opt/oracle \
&& cd /opt/oracle \
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-basic-linux.x64-12.1.0.2.0.zip \
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-sdk-linux.x64-12.1.0.2.0.zip \
&& unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
&& unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
&& ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \
&& ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \
&& ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \
&& rm -rf /opt/oracle/*.zip \
# Install PHP extensions deps
&& apt-get update \
&& apt-get install --no-install-recommends -y \
libaio-dev \
freetds-dev && \
# Install PHP extensions
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10; \
else \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8; \
fi \
&& docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \
&& docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
&& docker-php-ext-install \
pdo_oci \
&& docker-php-ext-enable \
oci8 \
;fi
###########################################################################
# IonCube Loader:
###########################################################################

View File

@ -708,6 +708,47 @@ RUN set -xe; \
&& echo 'aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \
;fi
###########################################################################
# PHP OCI8:
###########################################################################
USER root
ARG INSTALL_OCI8=false
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_12_1"
ENV OCI_HOME="/opt/oracle/instantclient_12_1"
ENV OCI_LIB_DIR="/opt/oracle/instantclient_12_1"
ENV OCI_INCLUDE_DIR="/opt/oracle/instantclient_12_1/sdk/include"
ENV OCI_VERSION=12
RUN if [ ${INSTALL_OCI8} = true ]; then \
# Install wget
apt-get update && apt-get install --no-install-recommends -y wget \
# Install Oracle Instantclient
&& mkdir /opt/oracle \
&& cd /opt/oracle \
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-basic-linux.x64-12.1.0.2.0.zip \
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-sdk-linux.x64-12.1.0.2.0.zip \
&& unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
&& unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
&& ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \
&& ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \
&& ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \
&& rm -rf /opt/oracle/*.zip \
# Install PHP extensions deps
&& apt-get update \
&& apt-get install --no-install-recommends -y \
libaio-dev && \
# Install PHP extensions
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10; \
else \
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8; \
fi \
&& echo "extension=oci8.so" >> /etc/php/${LARADOCK_PHP_VERSION}/cli/php.ini \
&& php -m | grep -q 'oci8' \
;fi
###########################################################################
# PHP V8JS:
###########################################################################