Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add volume to get data outside the container #14

Open
jmaister opened this issue Sep 25, 2015 · 9 comments
Open

Add volume to get data outside the container #14

jmaister opened this issue Sep 25, 2015 · 9 comments

Comments

@jmaister
Copy link

No description provided.

@felipear89
Copy link

Is there any way to do this?

@MaksymBilenko
Copy link

There is a solution in fork of this project: https://github.com/MaksymBilenko/docker-oracle-xe-11g

@atamanroman
Copy link

Please add VOLUME /u01 to the Dockerfile. A Database which loses all data on restart is quite pointless. Mariadb/Mysql do the same in their images.

@MaksymBilenko
Copy link

@atamanroman This is not going to work. There is a tricky dependencies.

  • If you would add VOLUME /u01 - database wouldn't start cause of there would be no DB installation in there.
  • And if you would mount only oradata folder - this is not going to work cause of Oracle requires DB configuration that stores on the different folder.

Here is an example of working solution in entrypoint:
On the Docker build image step do this:

mv /u01/app/oracle/product /u01/app/oracle-product

On the entrypoint:

rm -f /u01/app/oracle/product       #Just to make sure that there is no files
ln -s /u01/app/oracle-product /u01/app/oracle/product    #Mound database installation to the Expanded VOLUME of container

ln -s /u01/app/oracle/dbs /u01/app/oracle-product/11.2.0/xe/dbs    #Link db configuration to the installation path form extended volume with DB data

And then start DB.
you can take a look on the implementation of this by link on my previous comment

@atamanroman
Copy link

I made /u01 a volume and everything seems to work fine. Data is persisted between container restarts. Why would there be no DB installation in that folder if it was a volume?

VOLUME /u01 does not empty that folder. On initial container start all content in /u01 is copied into the volume. That's exactly the same default mariadb/mysql provides. I don't see the problem (but there might be one I don't see?).

@dragonbest520
Copy link

Add volume when running the container.
docker run --name oracle11g -d -p 49161:22 -p 1522:1521 -p 49163:8080 -v /oracle11g-data/:/u01/app/oracle/oradata/oracle11g-data/ -e ORACLE_ALLOW_REMOTE=true --restart=always wnameless/oracle-xe-11g

@cbdavide
Copy link

cbdavide commented Jan 29, 2019

Hi @dragonbest520, I'm setting the volume the same way as you do, but when I check the folder /oracle11g-data/ on the host machine is empty do you know what the problem is?

@mikperic
Copy link

mikperic commented May 8, 2020

Hi @cbdavide @dragonbest520
For me /oracle11g-data/ is also empty. Did you solve it? Why would we mount /oracle11g-data/ if Oracle data (tables) are not stored there?

@liangwenzhong
Copy link

For me /oracle11g-data/ is also empty ~~ @cbdavide @dragonbest520

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants