Created
October 27, 2018 09:56
-
-
Save redknitin/c937444db2e84389af7f0c1556276498 to your computer and use it in GitHub Desktop.
Dockerfile for cx_Oracle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#src/app.py | |
import cx_Oracle | |
DB_USER = 'ifsapp' | |
DB_PASS = 'ifsaapp' | |
DB_HOST = '192.168.0.201/orcl' | |
conn = cx_Oracle.connect(DB_USER, DB_PASS, DB_HOST) | |
cur = conn.cursor() | |
cur.execute('SELECT count(1) cnt FROM equipment_functional_uiv') | |
print(cur.fetchone()[0]) | |
cur.close() | |
conn.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:18.04 | |
COPY ./sources_list /etc/apt/sources.list | |
#The above fixes the 404 by providing an alternate repo specific to 18.04 | |
#FROM ubuntu:latest | |
RUN apt-get update -y | |
RUN apt-get upgrade -y | |
RUN apt install -y wget build-essential libaio-dev python3 python3-setuptools python3-pip python3-dev zip unzip net-tools iputils-ping | |
#CMD ping -c 4 www.google.com | |
#RUN easy-install pip | |
RUN mkdir -p /opt/oracle | |
WORKDIR /opt/oracle | |
COPY instantclient-basic-linux.x64-18.3.0.0.0dbru.zip . | |
COPY instantclient-sdk-linux.x64-18.3.0.0.0dbru.zip . | |
RUN unzip -o instantclient-basic-linux.x64-18.3.0.0.0dbru.zip -d /opt/oracle | |
RUN unzip -o instantclient-sdk-linux.x64-18.3.0.0.0dbru.zip -d /opt/oracle | |
RUN mv instantclient_18_3 instantclient | |
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient" | |
ENV OCI_HOME="/opt/oracle/instantclient" | |
ENV OCI_LIB_DIR="/opt/oracle/instantclient" | |
ENV OCI_INCLUDE_DIR="/opt/oracle/instantclient/sdk/include" | |
ENV OCI_VERSION=18 | |
RUN echo '/opt/oracle/instantclient/' | tee -a /etc/ld.so.conf.d/oracle_instant_client.conf && ldconfig | |
RUN python3 -m pip install cx_Oracle | |
#EXPOSE 5000 | |
#ENV FLASK_APP=./app.py | |
COPY src/app.py /app.py | |
RUN python3 /app.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#For Ubuntu 18.04 (Bionic) | |
deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse | |
deb http://in.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse | |
deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment