Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
FROM debian:wheezy
FROM debian:latest
# Reduce output from debconf
env DEBIAN_FRONTEND noninteractive

ENV DEBIAN_FRONTEND noninteractive
# Install python-dev, alien and libaio1 package (for sqlplus) and some python libraries
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils git wget libaio1 alien build-essential dpkg-dev python-dev python-pip python-scapy ca-certificates
# Removed apt-utils wget dpkg-dev
RUN apt update && apt-get install -y --no-install-recommends git libaio1 alien build-essential python3-dev python3-pip python3-scapy ca-certificates &&\
apt clean &&\
rm -rf /var/lib/apt/lists/*
WORKDIR /tmp
# Generate DEB files from RPM files to install instant client basic, sdk and sqlplus
ADD oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm /tmp/oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm
ADD oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm /tmp/oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm
ADD oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm /tmp/oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm
RUN alien --to-deb oracle-instantclient12.1-basic-12.1.0.1.0-1.x86_64.rpm oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.x86_64.rpm oracle-instantclient12.1-devel-12.1.0.1.0-1.x86_64.rpm
RUN dpkg -i oracle-instantclient12.1-basic_12.1.0.1.0-2_amd64.deb oracle-instantclient12.1-sqlplus_12.1.0.1.0-2_amd64.deb oracle-instantclient12.1-devel_12.1.0.1.0-2_amd64.deb
RUN bash -c 'rm *.{deb,rpm}'
# Define Oracle env variables
RUN bash -c 'echo "export ORACLE_HOME=/usr/lib/oracle/12.1/client64" >> /etc/profile'
RUN bash -c 'echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$ORACLE_HOME/lib" >> /etc/profile'
RUN bash -c 'echo "export PATH=\$ORACLE_HOME/bin:\$PATH" >> /etc/profile'
# Create the /etc/ld.so.conf.d/oracle.conf file and add the path to Oracle home
RUN bash -c 'echo "/usr/lib/oracle/12.1/client64/lib/" > /etc/ld.so.conf.d/oracle.conf'
RUN bash -c 'ldconfig'
# Install CX_Oracle
RUN bash -cl 'pip install cx_Oracle -i https://pypi.python.org/simple/'
# Install some python libraries and pyinstaller
RUN pip install colorlog termcolor pycrypto argcomplete pyinstaller -i https://pypi.python.org/simple/
RUN activate-global-python-argcomplete
ADD oracle-* /tmp/
RUN alien --to-deb oracle-* &&\
dpkg -i oracle-*.deb &&\
bash -c 'rm *.{deb,rpm}'
# Define Oracle env variables & Create the /etc/ld.so.conf.d/oracle.conf file and add the path to Oracle home
RUN bash -c '\
SQLPLUS_Lib=$(find / -name "libsqlplus.so") &&\
SQLPLUS_Folder=${SQLPLUS_Lib%/lib/libsqlplus.so} &&\
echo "export ORACLE_HOME=${SQLPLUS_Folder}" >> /etc/profile &&\
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$ORACLE_HOME/lib" >> /etc/profile &&\
echo "export PATH=\$ORACLE_HOME/bin:\$PATH" >> /etc/profile &&\
echo "$ORACLE_HOME/lib/" > /etc/ld.so.conf.d/oracle.conf &&\
ldconfig'
# Install CX_Oracle, Python libraries and pyinstaller
RUN pip install cx_Oracle colorlog termcolor pycrypto argcomplete pyinstaller python-libnmap passlib -i https://pypi.python.org/simple/ &&\
activate-global-python-argcomplete
# Change to /root et clone odat project
WORKDIR /root
RUN git clone https://github.com/quentinhardy/odat.git
RUN git clone --branch master-python3 --single-branch https://github.com/quentinhardy/odat.git
WORKDIR odat
ENTRYPOINT ["python3", "odat.py"]