Skip to content

Commit 1ded4a6

Browse files
author
João Zonta
committed
Merge branch 'add_oci8_supports' of https://github.com/jzonta/laradock into add_oci8_supports
2 parents 04c6aaf + 559acc2 commit 1ded4a6

4 files changed

Lines changed: 90 additions & 0 deletions

File tree

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ services:
8484
- INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI}
8585
- INSTALL_DRUPAL_CONSOLE=${WORKSPACE_INSTALL_DRUPAL_CONSOLE}
8686
- INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE}
87+
- INSTALL_OCI8=${WORKSPACE_INSTALL_OCI8}
8788
- INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS}
8889
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
8990
- COMPOSER_AUTH=${WORKSPACE_COMPOSER_AUTH}
@@ -169,6 +170,7 @@ services:
169170
- INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE}
170171
- INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF}
171172
- INSTALL_AEROSPIKE=${PHP_FPM_INSTALL_AEROSPIKE}
173+
- INSTALL_OCI8=${PHP_FPM_INSTALL_OCI8}
172174
- INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI}
173175
- INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL}
174176
- INSTALL_PG_CLIENT=${PHP_FPM_INSTALL_PG_CLIENT}

env-example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ WORKSPACE_DRUSH_VERSION=8.1.17
114114
WORKSPACE_INSTALL_DRUPAL_CONSOLE=false
115115
WORKSPACE_INSTALL_WP_CLI=false
116116
WORKSPACE_INSTALL_AEROSPIKE=false
117+
WORKSPACE_INSTALL_OCI8=false
117118
WORKSPACE_INSTALL_V8JS=false
118119
WORKSPACE_INSTALL_LARAVEL_ENVOY=false
119120
WORKSPACE_INSTALL_LARAVEL_INSTALLER=false
@@ -173,6 +174,7 @@ PHP_FPM_INSTALL_XSL=false
173174
PHP_FPM_INSTALL_GMP=false
174175
PHP_FPM_INSTALL_EXIF=false
175176
PHP_FPM_INSTALL_AEROSPIKE=false
177+
PHP_FPM_INSTALL_OCI8=false
176178
PHP_FPM_INSTALL_PGSQL=false
177179
PHP_FPM_INSTALL_GHOSTSCRIPT=false
178180
PHP_FPM_INSTALL_LDAP=false

php-fpm/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,51 @@ RUN set -xe; \
446446
&& docker-php-ext-enable aerospike \
447447
;fi
448448

449+
###########################################################################
450+
# PHP OCI8:
451+
###########################################################################
452+
453+
ARG INSTALL_OCI8=false
454+
455+
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_12_1"
456+
ENV OCI_HOME="/opt/oracle/instantclient_12_1"
457+
ENV OCI_LIB_DIR="/opt/oracle/instantclient_12_1"
458+
ENV OCI_INCLUDE_DIR="/opt/oracle/instantclient_12_1/sdk/include"
459+
ENV OCI_VERSION=12
460+
461+
RUN if [ ${INSTALL_OCI8} = true ]; then \
462+
# Install wget
463+
apt-get update && apt-get install --no-install-recommends -y wget \
464+
# Install Oracle Instantclient
465+
&& mkdir /opt/oracle \
466+
&& cd /opt/oracle \
467+
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-basic-linux.x64-12.1.0.2.0.zip \
468+
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-sdk-linux.x64-12.1.0.2.0.zip \
469+
&& unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
470+
&& unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
471+
&& ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \
472+
&& ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \
473+
&& ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \
474+
&& rm -rf /opt/oracle/*.zip \
475+
# Install PHP extensions deps
476+
&& apt-get update \
477+
&& apt-get install --no-install-recommends -y \
478+
libaio-dev \
479+
freetds-dev && \
480+
# Install PHP extensions
481+
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
482+
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10; \
483+
else \
484+
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8; \
485+
fi \
486+
&& docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \
487+
&& docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
488+
&& docker-php-ext-install \
489+
pdo_oci \
490+
&& docker-php-ext-enable \
491+
oci8 \
492+
;fi
493+
449494
###########################################################################
450495
# IonCube Loader:
451496
###########################################################################

workspace/Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,47 @@ RUN set -xe; \
720720
&& echo 'aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua' >> /etc/php/${LARADOCK_PHP_VERSION}/cli/conf.d/aerospike.ini \
721721
;fi
722722

723+
###########################################################################
724+
# PHP OCI8:
725+
###########################################################################
726+
727+
USER root
728+
ARG INSTALL_OCI8=false
729+
730+
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_12_1"
731+
ENV OCI_HOME="/opt/oracle/instantclient_12_1"
732+
ENV OCI_LIB_DIR="/opt/oracle/instantclient_12_1"
733+
ENV OCI_INCLUDE_DIR="/opt/oracle/instantclient_12_1/sdk/include"
734+
ENV OCI_VERSION=12
735+
736+
RUN if [ ${INSTALL_OCI8} = true ]; then \
737+
# Install wget
738+
apt-get update && apt-get install --no-install-recommends -y wget \
739+
# Install Oracle Instantclient
740+
&& mkdir /opt/oracle \
741+
&& cd /opt/oracle \
742+
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-basic-linux.x64-12.1.0.2.0.zip \
743+
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-sdk-linux.x64-12.1.0.2.0.zip \
744+
&& unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
745+
&& unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
746+
&& ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \
747+
&& ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \
748+
&& ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \
749+
&& rm -rf /opt/oracle/*.zip \
750+
# Install PHP extensions deps
751+
&& apt-get update \
752+
&& apt-get install --no-install-recommends -y \
753+
libaio-dev && \
754+
# Install PHP extensions
755+
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
756+
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10; \
757+
else \
758+
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8; \
759+
fi \
760+
&& echo "extension=oci8.so" >> /etc/php/${LARADOCK_PHP_VERSION}/cli/php.ini \
761+
&& php -m | grep -q 'oci8' \
762+
;fi
763+
723764
###########################################################################
724765
# PHP V8JS:
725766
###########################################################################

0 commit comments

Comments
 (0)