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

mysql/mariadb support #5

Closed
apcarp opened this issue Mar 8, 2024 · 3 comments
Closed

mysql/mariadb support #5

apcarp opened this issue Mar 8, 2024 · 3 comments

Comments

@apcarp
Copy link
Contributor

apcarp commented Mar 8, 2024

I don't see an obvious way to support mysql/mariadb databases with this image similarly to oracle. I have a wildfly app that uses a mysql database. I hope it is relatively straightforward to add similar functionality for mariadb/mysql as exists for oracle.

@slominskir
Copy link
Member

Need to add a function to server-setup.sh to download and install the MySQL (actually prob MariaDB) driver during server setup similar to the oracle equivalent:

config_oracle_driver() {

Then add a function to the app-setup.sh for MySQL similar to the oracle equivalent:

config_oracle_client() {

Aside
I've been experimenting with the best way to manage a bash library and it may be to "import" a set of functions by sourcing instead of executing a script with env args. This is relevant in that the current Wildfly scripts by default execute all functions in order unless you pass a command line arg. In other words: if users must choose between MySQL or Oracle it's probably better to avoid default and instead force users to explicitly enumerate desired functions. We may end up modifying the Wildfly scripts to work more like the new way I'm handling the Keycloak bash scripts here: https://github.com/JeffersonLab/keycloak/blob/main/scripts/lib.sh

and for example, the lib.sh is sourced and then functions are invoked such as:

https://github.com/JeffersonLab/keycloak/blob/main/container/keycloak/initdb.d/04_accounts.sh

@apcarp
Copy link
Contributor Author

apcarp commented Mar 11, 2024

I made good progress on Friday, I am and testing it with an app I'm converting over to development docker. I didn't mess with the import approach, but I think that's a more minor change within the context of the jeffersonlab/widfly image. It's all the downstream work that would be a pain.

I might be missing something about your approach, but I think I would rather have to supply a required argument to the script that specifies the type of database. than create my script using a library of functions for each downstream image. Even better would be to check for the presence of an environment variable like ORACLE_RESOURCE or MARIADB_RESOURCE and do the right thing.

@slominskir
Copy link
Member

Closed in release 1.5.0

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