Oracle on Docker with pre-pumped Data
I've realized volumes mount for db data.Here is my fork:
- Reduce size of image from 3.8G to 825Mb
- Database initialization moved out of the image build phase. Now database initializes at the containeer startup with no database files mounted
- media reuse support outside of container. Added graceful shutdown on containeer stop
- Removed sshd
You may check here:
I tried mapping the datafiles and fast recovery directories in my oracle xe container. However, I changed my mind after losing the files ... so you should be very careful about this approach and understand how docker manages those spaces under all operations.
I found, for example, that if you clean out old containers, the contents of the mapped directories will be deleted even if they are mapped to something outside the docker system area (/var/lib/docker). You can avoid this by keeping containers and starting them up again. But, if you want to version and make a new image... you have to backup those files.
Oracle also id's the files themselves (checksum or inode # or something) and complains about them on startup.... I did not investigate the extent of that issue or even if there is indeed any issue there.
I've opted to not map any of those files/dirs and plan to use datapump or whatever to get the data out until I get a better handle on all that can happen.
So I update the data and version the image... pushing to to the repo for safe-keeping