Skip to content

Commit f6bef7a

Browse files
committed
Fixed issue with ownership of mounted data folders.
Fixed issue with Gracefull shutdown of service.
1 parent 4d09e02 commit f6bef7a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM ubuntu:14.04.1
22

33
MAINTAINER Maksym Bilenko <[email protected]>
44

5-
ADD entrypoint.sh /
65
ADD chkconfig /sbin/chkconfig
76
ADD oracle-install.sh /oracle-install.sh
87
ADD init.ora /
@@ -21,4 +20,5 @@ EXPOSE 1521
2120
EXPOSE 8080
2221
VOLUME ["/u01/app/oracle/oradata"]
2322

23+
ADD entrypoint.sh /
2424
ENTRYPOINT ["/entrypoint.sh"]

entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#!/bin/bash
22

3+
# Prevent owner issues on mounted folders
4+
chown -R oracle:dba /u01/app/oracle
5+
# Update hostname
36
sed -i -E "s/HOST = [^)]+/HOST = $HOSTNAME/g" /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
47

58
case "$1" in
@@ -13,7 +16,6 @@ case "$1" in
1316
echo "export PATH=$ORACLE_HOME/bin:$PATH" >> /etc/bash.bashrc
1417
echo "export ORACLE_SID=XE" >> /etc/bash.bashrc
1518
printf 8080\\n1521\\noracle\\noracle\\ny\\n | /etc/init.d/oracle-xe configure
16-
/etc/init.d/oracle-xe stop || true
1719
echo "Database initialized. Please visit http://#containeer:8080/apex to proceed with configuration"
1820
fi
1921

@@ -23,10 +25,9 @@ case "$1" in
2325
##
2426
## Workaround for graceful shutdown. ....ing oracle... ‿( ́ ̵ _-`)‿
2527
##
26-
trap "/etc/init.d/oracle-xe stop && kill -9 $$" INT TERM
27-
while [ 1 ]; do
28+
while [ "$END" == '' ]; do
2829
sleep 1
29-
true
30+
trap "/etc/init.d/oracle-xe stop && END=1" INT TERM
3031
done
3132
;;
3233

oracle-install.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ rm -f /oracle-xe_11.2.0-1.0_amd64.deb*
99
mv /init.ora /u01/app/oracle/product/11.2.0/xe/config/scripts
1010
mv /initXETemp.ora /u01/app/oracle/product/11.2.0/xe/config/scripts
1111

12-
chown -R oracle:dba /u01/app/oracle
13-
1412
apt-get clean && rm -rf /tmp/* /var/lib/apt/lists/* /var/tmp/*

0 commit comments

Comments
 (0)