Oracle on docker with pre-paged data

I am using the following basic docker file:

https://github.com/wnameless/docker-oracle-xe-11g/blob/master/Dockerfile

I read a little about how to set up Volumne data from this SO question and this blog , but am not sure how to combine the pieces.

In short, I would like to manage the oracle data only in the Docker image only, how to do this?

+6
source share
3 answers

I have implemented volumes for db data. Here is my fork:

  • Reduce image size from 3.8G to 825Mb
  • Initializing the database is out of the build phase of the image. Now the database is initialized when the container starts without adding database files.
  • Support for reuse of media outside the container. Added graceful shutdown at a limited stop.
  • Removed sshd

You can check here:

https://registry.hub.docker.com/u/sath89/oracle-xe-11g

https://github.com/MaksymBilenko/docker-oracle-xe-11g

+4
source

I tried to map data files and fast recovery directories in my oracle xe container. However, I changed my mind after losing files ... so you have to be very careful in this approach and understand how docker manages these spaces in all operations.

I found, for example, that if you empty 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 storing containers and starting them again. But, if you want to change the version and create a new image ... you need to backup these files.

Oracle also identifies the files themselves (checksum or inode # or something else) and complains about them at startup. I have not investigated the extent of this problem, or even if there really is any problem there.

I decided not to match any of these / dirs files and plan on using datapump or something else to get the data until I get the best handle to everything that can happen.

So, I am updating the data and version of the image ... by clicking on the repo to save

+2
source

Generally:

# Start data container docker run -d -v /dbdata --name dbdata -it ubuntu # Put oracale data in /dbdata some how # Start container with stabase and look for data at /dbdata docker run -d --volumes-from dbdata --name db -it ubuntu 
0
source

Source: https://habr.com/ru/post/977012/


All Articles