I need an oracle database instance in my dev environment and I found oracleinanutshell/oracle-xe-11g in Docker Hub.
My dataset is a big one. It would be good to keep the database file outside the container for future use.
I moved all necessary folders from container to host.
/media/db/oracle
├── admin
│ └── XE
│ ├── adump
│ └── dpdump
├── diag
│ ├── rdbms
│ └── tnslsnr
├── fast_recovery_area
│ └── XE
└── oradata
└── XE
├── control.dbf
├── sysaux.dbf
├── system.dbf
├── temp.dbf
├── undotbs1.dbf
└── users.dbf
And started the container like this:
sudo docker run -d --name oracle \
-p 49161:1521 -p 8080:8080 \
-v /media/db/oracle/admin:/u01/app/oracle/admin \
-v /media/db/oracle/diag:/u01/app/oracle/diag \
-v /media/db/oracle/fast_recovery_area:/u01/app/oracle/fast_recovery_area \
-v /media/db/oracle/oradata:/u01/app/oracle/oradata \
oracleinanutshell/oracle-xe-11g \
/
It works.
My question is: Is there a better way to do this?