Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working Docker File based on ubuntu #52

Open
wants to merge 1 commit into
base: master-python3
Choose a base branch
from
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
Working Docker File -- Based on Ubuntu, Oracle v11.2, Symlinks and EN…
…V for TZData to fix docker hang on build
opsec-infosec committed Nov 14, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a127b01a6b3a7fb9def5d3a32bd36f28f4f9774a
32 changes: 20 additions & 12 deletions Docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
FROM debian:wheezy
FROM ubuntu:latest
# Reduce output from debconf
env DEBIAN_FRONTEND noninteractive
ENV UBUNTU_FRONTEND noninteractive

ENV TZ=Asia/Dubai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV PATH="$PATH:/usr/lib/oracle/11.2/client64/bin:/root/odat"

# 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
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils git wget libaio1 alien build-essential dpkg-dev python3-dev python3-pip python3-scapy ca-certificates python3-setuptools python3-pip iputils-ping netcat traceroute net-tools
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
ADD oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm /tmp/oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
ADD oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm /tmp/oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
ADD oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm /tmp/oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
RUN ls /tmp
RUN alien --to-deb oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
RUN ls /tmp
RUN dpkg -i oracle-instantclient11.2-basic_11.2.0.4.0-2_amd64.deb oracle-instantclient11.2-sqlplus_11.2.0.4.0-2_amd64.deb oracle-instantclient11.2-devel_11.2.0.4.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 ORACLE_HOME=/usr/lib/oracle/11.2/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 'echo "/usr/lib/oracle/11.2/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/'
RUN bash -cl 'pip3 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 pip3 install colorlog termcolor pycrypto argcomplete pyinstaller passlib -i https://pypi.python.org/simple/
RUN activate-global-python-argcomplete
# Change to /root et clone odat project
WORKDIR /root
RUN git clone https://github.com/quentinhardy/odat.git
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN ln -s /root/odat/odat.py /root/odat/odat
WORKDIR odat