DEV Community

Doctorx
Doctorx

Posted on

Oracle client for 11g database on M2

We are having trouble connecting to Oracle with the Python Oracle client on the M2 laptop. I spent a lot of time trying to find out how to connect Python with python_oracle. The official Oracle site has clients only for old MAC or Amd64/Linux, but it doesn't work directly.

My colleague found enough elegant solutions with Docker with platform: linux/amd64
He added to a composer file.

 ports: - 9001:8000 platform: linux/amd64 volumes: 
Enter fullscreen mode Exit fullscreen mode

Download in Docker file:

WORKDIR /opt/oracle RUN apt-get update \ && apt-get install -y libaio1 wget unzip \ && wget https://download.oracle.com/otn_software/linux/instantclient/1915000/instantclient-basiclite-linux.x64-19.15.0.0.0dbru-2.zip \ && unzip instantclient-basiclite-linux.x64-19.15.0.0.0dbru-2.zip \ && rm -f instantclient-basiclite-linux.x64-19.15.0.0.0dbru-2.zip \ && cd /opt/oracle/instantclient_19_15 \ && rm -f *jdbc* *occi* *mysql* *README *jar uidrvci genezi adrci \ && echo /opt/oracle/instantclient_19_15 > /etc/ld.so.conf.d/oracle-instantclient.conf \ && ldconfig \ && apt-get purge -y --auto-remove wget unzip 
Enter fullscreen mode Exit fullscreen mode

Documentation:
https://docs.docker.com/build/building/multi-platform/

Top comments (0)