I'm trying to install and enable OCI8 in dockerfile for php:8.0-fpm-alpine image to ..
This is a part of my Dockerfile:
ARG PHP_VERSION=8.0
FROM php:${PHP_VERSION}-fpm-alpine AS api_platform_php
# Install Oracle Instantclient
RUN mkdir /usr/lib/oracle
RUN apk --no-cache add libaio curl && \
curl -o instantclient.zip https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-basic-linux.x64-21.7.0.0.0dbru.zip -SL && \
curl -o instantclient-sdk.zip https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-sdk-linux.x64-21.7.0.0.0dbru.zip -SL && \
unzip instantclient.zip && unzip instantclient-sdk.zip &&\
mv instantclient_21_7 /usr/lib/oracle/ && \
rm instantclient.zip && rm instantclient-sdk.zip && \
cd /usr/lib/oracle/instantclient_21_7 \
&& ln -sf libclntsh.so.21.1 libclntsh.so \
&& ln -sf libclntshcore.so.21.1 libclntshcore.so \
&& ln -sf libocci.so.21.1 libocci.so \
&& rm -rf *.zip
#ENV LD_LIBRARY_PATH /usr/lib/oracle/instantclient
#ENV ORACLE_BASE /usr/lib/oracle/instantclient
#ENV TNS_ADMIN /usr/lib/oracle/instantclient
#ENV ORACLE_HOME /usr/lib/oracle/instantclient
# Install Oracle extensions
RUN docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/usr/lib/oracle/instantclient_21_7 \
&& echo 'instantclient > /usr/lib/oracle/instantclient_21_7/' \
&& ldconfig | pecl install oci8-3.0.1 \
&& docker-php-ext-install \
pdo_oci \
&& docker-php-ext-enable \
oci8
The result is as follow :
(...)
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/extensions/no-debug-non-zts-20200930
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking for Oracle Database OCI8 support... yes, shared
checking PHP version... 8.0.17, ok
checking OCI8 DTrace support... no
checking size of long... 8
checking if we're at 64-bit platform... yes
configure: WARNING: OCI8 extension: ORACLE_HOME is not set, looking for default Oracle Instant Client instead
checking Oracle Instant Client directory... configure: error: Oracle Instant Client directory /usr/lib/oracle/.../client64/lib libraries not found. Try --with-oci8=instantclient,DIR
configure: error: Oracle Instant Client directory /usr/lib/oracle/.../client64/lib libraries not found. Try --with-oci8=instantclient,DIR
Thanks for your help
I have Succeed to enable the extension...
I think my issue was the order of the installation.
Here the full Dockerfile :