Installing Oracle 21_12 instantclient in Docker

151 Views Asked by At

I'm running a Python Flask app connected to an Oracle database. I am receiving the following error in my Docker container when attempting to connect to Oracle.

enter image description here

Here is the portion of my Dockerfile related to Oracle:

# Installing Oracle instant client
RUN apt-get update && \
    apt-get install -y libpq-dev zlib1g-dev build-essential shared-mime-info libaio1 libaio-dev unzip wget --no-install-recommends && \
    mkdir -p /opt/oracle && \
    cd /opt/oracle && \
    wget https://download.oracle.com/otn_software/linux/instantclient/2112000/instantclient-basic-linux.x64-21.12.0.0.0dbru.zip && \
    unzip instantclient-basic-linux.x64-21.12.0.0.0dbru.zip && \
    rm -rf instantclient-basic-linux.x64-21.12.0.0.0dbru.zip

COPY tnsnames.ora /opt/oracle/instantclient_21_12/network/admin/
COPY sqlnet.ora /opt/oracle/instantclient_21_12/network/admin/

ENV LD_LIBRARY_PATH=/opt/oracle/instantclient_21_12
ENV ORACLE_HOME=/opt/oracle/instantclient_21_12

RUN chmod -R 755 $ORACLE_HOME

RUN ldconfig

I understand the error is stating that the cx_Oracle package can't locate the "libclntsh.so" file, but the paths it's looking in (according to the Docker logs) DOES contain the file and has the correct permissions.

I can see the ENV vars set properly when doing a printenv within the Docker container as well.

Am I missing something simple?

0

There are 0 best solutions below