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

Is it possible to create more than one database when init container? #286

Open
EKwongChum opened this issue May 20, 2020 · 2 comments
Open

Comments

@EKwongChum
Copy link

While we use this resposity's image mysql-57-centos7 ,we want to create more than one database when init container. Is it possible to run some commands like

docker container run --detach --name mysql_database -e MYSQL_USER=myuser -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=db1,db2,db3 -p 3306:3306 mysql-57-centos7:latest

to create three databases: db1, db2 and db3 when init container?

@hhorak
Copy link
Member

hhorak commented Feb 22, 2021

It is possible to extend the image by mounting some SQL query and a script to a proper place or building you own layer on top of the image. See the "Extending image" section in the doc: https://github.com/sclorg/mysql-container/tree/master/8.0#extending-image

@hhorak
Copy link
Member

hhorak commented Feb 22, 2021

Well, the suggested approach in #287 might be actually a nice enhancement. We'll consider it.

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

2 participants