Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created May 24, 2018 09:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kopiro/124f3ef56eb9d65c619b378f069b81f4 to your computer and use it in GitHub Desktop.
Save kopiro/124f3ef56eb9d65c619b378f069b81f4 to your computer and use it in GitHub Desktop.
Dockerfile-oci8
FROM php:7.1-fpm
RUN set -ex && \
apt-get update && \
apt-get -y --no-install-recommends install \
apt-utils \
unzip \
nano \
git
# Copy LIB
ADD ./lib /tmp/lib
ARG ORACLE_VERSION=12.2.0.1.0
ARG ORACLE_LIB_VERSION=12.1
ARG ORACLE_DIR_VERSION=12_2
ARG ORACLE_INSTALLATION_PATH=/usr/local/instantclient
RUN apt-get -y --no-install-recommends install libaio-dev && \
unzip /tmp/lib/instantclient-basic-linux.x64-${ORACLE_VERSION}.zip -d /usr/local/ && \
unzip /tmp/lib/instantclient-sdk-linux.x64-${ORACLE_VERSION}.zip -d /usr/local/ && \
unzip /tmp/lib/instantclient-sqlplus-linux.x64-${ORACLE_VERSION}.zip -d /usr/local/ && \
ln -svf /usr/local/instantclient_${ORACLE_DIR_VERSION} ${ORACLE_INSTALLATION_PATH} && \
ln -svf ${ORACLE_INSTALLATION_PATH}/libclntsh.so.${ORACLE_LIB_VERSION} ${ORACLE_INSTALLATION_PATH}/libclntsh.so && \
ln -svf ${ORACLE_INSTALLATION_PATH}/libclntshcore.so.${ORACLE_LIB_VERSION} ${ORACLE_INSTALLATION_PATH}/libclntshcore.so && \
ln -svf ${ORACLE_INSTALLATION_PATH}/libocci.so.${ORACLE_LIB_VERSION} ${ORACLE_INSTALLATION_PATH}/libocci.so && \
ln -svf ${ORACLE_INSTALLATION_PATH}/sqlplus /usr/bin/sqlplus && \
docker-php-ext-configure oci8 --with-oci8="instantclient,${ORACLE_INSTALLATION_PATH}" && \
docker-php-ext-install oci8 && \
echo ${ORACLE_INSTALLATION_PATH} > /etc/ld.so.conf.d/oci8.conf && \
ldconfig && \
(if ! php -i | grep "oci8"; then echo "Unable to find oci8 in php -i"; exit 1; fi)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment