I\'m trying to connect to an Oracle database at my company through my docker container that contains some of my python scripts with the package cx_Oracle. After i build and
One solution is to try:
FROM python:3.7.4-slim-buster
RUN apt-get update && apt-get install -y libaio1 wget unzip
WORKDIR /opt/oracle
RUN wget https://download.oracle.com/otn_software/linux/instantclient/instantclient-basiclite-linuxx64.zip && \
unzip instantclient-basiclite-linuxx64.zip && rm -f instantclient-basiclite-linuxx64.zip && \
cd /opt/oracle/instantclient* && rm -f *jdbc* *occi* *mysql* *README *jar uidrvci genezi adrci && \
echo /opt/oracle/instantclient* > /etc/ld.so.conf.d/oracle-instantclient.conf && ldconfig
RUN python -m pip install cx_Oracle
If you use a different base image you may not need to explicitly install unzip or libaio1. If you're happy using ADD, then you won't need wget either.
Also there is a recent Oracle webcast recording discussing cx_Oracle and Docker here.
Update: A new blog post series on this is at Docker for Oracle Database Applications in Node.js and Python.
Update 2: Oracle has Python Dockerfiles at https://github.com/oracle/docker-images/tree/master/OracleLinuxDevelopers