forked from plmwong/docker-oracle-xe-11g-soa
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
65 lines (50 loc) · 2.07 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM ubuntu:14.04.1
MAINTAINER PayByPhone <[email protected]>
ADD chkconfig /sbin/chkconfig
ADD init.ora /
ADD initXETemp.ora /
ADD oracle-xe_11.2.0-1.0_amd64.debaa /
ADD oracle-xe_11.2.0-1.0_amd64.debab /
ADD oracle-xe_11.2.0-1.0_amd64.debac /
# ADD oracle-xe_11.2.0-1.0_amd64.deb /
RUN cat /oracle-xe_11.2.0-1.0_amd64.deba* > /oracle-xe_11.2.0-1.0_amd64.deb
# Install sshd
RUN apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:admin' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
RUN echo "export VISIBLE=now" >> /etc/profile
# Prepare to install Oracle
RUN apt-get install -y libaio1 net-tools bc
RUN ln -s /usr/bin/awk /bin/awk
RUN mkdir /var/lock/subsys
RUN chmod 755 /sbin/chkconfig
# Install Oracle
RUN dpkg --install /oracle-xe_11.2.0-1.0_amd64.deb
RUN mv /init.ora /u01/app/oracle/product/11.2.0/xe/config/scripts
RUN mv /initXETemp.ora /u01/app/oracle/product/11.2.0/xe/config/scripts
RUN printf 8080\\n1521\\noracle\\noracle\\ny\\n | /etc/init.d/oracle-xe configure
RUN echo 'export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe' >> /etc/bash.bashrc
RUN echo 'export PATH=$ORACLE_HOME/bin:$PATH' >> /etc/bash.bashrc
RUN echo 'export ORACLE_SID=XE' >> /etc/bash.bashrc
# Post Oracle Steps
RUN mkdir -p /oracle/bootstrap
ADD post-oracle-install /oracle/post-oracle-install
ADD wait-for-oracle /oracle/wait-for-oracle
ADD has-oracle-started.sql /oracle/has-oracle-started.sql
ADD bootstrap /oracle/bootstrap
RUN chmod +x /oracle/post-oracle-install
RUN chmod +x /oracle/wait-for-oracle
# Create SOA qa environment dbf folder
RUN mkdir -p /opt/oracle/soap/dbf/
RUN chown -R oracle /opt/oracle
# Remove installation files
RUN rm /oracle-xe_11.2.0-1.0_amd64.deb*
EXPOSE 22
EXPOSE 1521
EXPOSE 8080
#CMD sed -i -E "s/HOST = [^)]+/HOST = $HOSTNAME/g" /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora; \
# service oracle-xe start; \
# /usr/sbin/sshd -D
CMD bash -C '/oracle/post-oracle-install';'bash'