diff --git a/docker-compose.yml b/docker-compose.yml index 26e342e..df1eae1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -91,6 +91,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} @@ -183,6 +184,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} diff --git a/env-example b/env-example index d538843..8c34265 100644 --- a/env-example +++ b/env-example @@ -118,6 +118,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 @@ -181,6 +182,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 diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 43fd1af..9cd52f9 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -450,6 +450,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: ########################################################################### diff --git a/workspace/Dockerfile b/workspace/Dockerfile index e83c434..57dd1f4 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -756,6 +756,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: ###########################################################################