Docker-images: Feature Request OracleDatabase - Run scripts on startup.

Created on 18 May 2017  路  6Comments  路  Source: oracle/docker-images

It would be great to be able to run scripts after the database has started. For example I want to do something mount a volume with:

For example I want to launch the container with a volume that contains scripts, and execute those scripts in the context of the container.

-v ./init:/docker-entrypoint-initdb.d

This mount would contain things like:
12c.init.sql

which would result in echo "exit" | $ORACLE_HOME/bin/sqlplus -s "/ as sysdba" @"/docker-entrypoint-initdb.d/12c.init.sql" being executed in the context of the container.

database

Most helpful comment

I added a pull request with what I was thinking #389. There are tons of use cases for this functionality. For example I could populate the schema after the database is launched.

All 6 comments

Can you do that by customizing your own image?

The MySQL container does something similar: https://github.com/mysql/mysql-docker/blob/mysql-server/5.7/docker-entrypoint.sh#L98-L105

I think it's actually a pretty good idea and means the base container is more flexible and doesn't require customisation.

I added a pull request with what I was thinking #389. There are tons of use cases for this functionality. For example I could populate the schema after the database is launched.

@brunoborges Following back up. I sent you an updated OCA.

Thank you @jcustenborder. There are some minor changes that I did request for this PR. Perhaps you can work on them in the meantime?

This has been implemented via #389 and #471. Thanks a lot for the contribution!

Was this page helpful?
0 / 5 - 0 ratings