Permalink
Please sign in to comment.
Showing
with
29 additions
and 13 deletions.
- +1 −0 .gitignore
- +5 −2 Dockerfile
- +10 −0 docker-compose.yml
- +13 −11 scripts/start.sh
1
.gitignore
@@ -0,0 +1 @@ | ||
+*.zip |
7
Dockerfile
@@ -1,11 +1,14 @@ | ||
-FROM saltfactory/oracle-xe:11g | ||
+FROM saltfactory/oracle-xe | ||
MAINTAINER SungKwang Song <saltfactory@gmail.com> | ||
ADD ./scripts /scripts | ||
RUN chmod +x /scripts/start.sh | ||
+ENV NLS_LANG=KOREAN_KOREA.UTF8 | ||
+ENV LANG=ko_KR.UTF-8 | ||
+ | ||
EXPOSE 22 | ||
EXPOSE 1521 | ||
EXPOSE 8080 | ||
-ENTRYPOINT /scripts/start.sh | ||
+CMD /scripts/start.sh |
10
docker-compose.yml
@@ -0,0 +1,10 @@ | ||
+app: | ||
+ build: . | ||
+ container_name: hbn-sqlschool | ||
+ restart: always | ||
+ environment: | ||
+ - NLS_LANG=KOREAN_KOREA.UTF8 | ||
+ - LANG=ko_KR.UTF-8 | ||
+ ports: | ||
+ - "9521:1521" | ||
+ - "9080:8080" |
24
scripts/start.sh
@@ -1,15 +1,17 @@ | ||
#!/bin/bash | ||
-sed -i -E "s/HOST = [^)]+/HOST = $HOSTNAME/g" /u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora; \ | ||
-service oracle-xe start | ||
+sed -i -E "s/HOST = [^)]+/HOST = $HOSTNAME/g" $ORACLE_HOME/network/admin/listener.ora | ||
+while true; do | ||
+ pmon=`ps -ef | grep pmon_$ORACLE_SID | grep -v grep` | ||
+ if [ "$pmon" == "" ] | ||
+ then | ||
+ date | ||
+ /etc/init.d/oracle-xe start | ||
-sh /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh | ||
-export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe | ||
-export ORACLE_SID=XE | ||
-export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh` | ||
-export PATH=$ORACLE_HOME/bin:$PATH | ||
+ sqlplus system/oracle @/scripts/create_user.sql | ||
+ sqlplus tutorial/tutorial @/scripts/example.sql | ||
+ echo "excuted sql scripts" | ||
+ fi | ||
+ sleep 1m | ||
+done; | ||
-sqlplus system/oracle @/scripts/create_user.sql | ||
-sqlplus tutorial/tutorial @/scripts/example.sql | ||
- | ||
-/usr/sbin/sshd -D |
0 comments on commit
749c73e