Skip to content

Commit 9341d2f

Browse files
authored
Merge pull request wnameless#41 from bpneumann/master
Add volume support
2 parents 889090b + 200063f commit 9341d2f

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ MAINTAINER Wei-Ming Wu <[email protected]>
55
ADD assets /assets
66
RUN /assets/setup.sh
77

8+
RUN mv /u01/app/oracle/oradata /u01/app/oracle/oradata.orig
9+
VOLUME /u01/app/oracle/oradata
10+
811
EXPOSE 22
912
EXPOSE 1521
1013
EXPOSE 8080

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ Run this, if you want the database to be connected remotely:
2525
docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g
2626
```
2727

28+
Run this to store data in a volume outside the docker container:
29+
```
30+
docker run -d -p 49160:22 -p 49161:1521 -v /my/data/folder:/u01/app/oracle/oradata wnameless/oracle-xe-11g
31+
```
32+
2833
Connect database with following setting:
2934
```
3035
hostname: localhost

assets/startup.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
#!/bin/bash
2+
3+
# Initialize the host's data volume, leaving a trace when finished.
4+
if [ ! -e /u01/app/oracle/oradata/dataloaded ]
5+
then
6+
cp -r /u01/app/oracle/oradata.orig/* /u01/app/oracle/oradata/
7+
touch /u01/app/oracle/oradata/dataloaded
8+
echo "Host data volume was initialized."
9+
else
10+
echo "Data was loaded from the host."
11+
fi
12+
213
LISTENER_ORA=/u01/app/oracle/product/11.2.0/xe/network/admin/listener.ora
314
TNSNAMES_ORA=/u01/app/oracle/product/11.2.0/xe/network/admin/tnsnames.ora
415

0 commit comments

Comments
 (0)