-
Notifications
You must be signed in to change notification settings - Fork 4
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
preferred way to use environment variable for configuring domain.xml #24
Comments
Hi, at the current state, GlassFish Docker just runs the GlassFish server, with minimal customization. Since GlassFish doesn’t support configuration using environment variables, what you describe is not possible. The next version of the Docker image will improve this a bit, it will be possible to configure the server with asadmin commands in a file: #22 This still doesn’t allow configuration using environment variables, but you can mount a directory with an asadmin script that configures a database connection pool or anything else. |
Thank you for your your quick reply. maybe the preboot / postboot file introduced in payara maybe a good start for backporting into this image? This mechanism would allow already the customization of the glassfish domain? |
We don't want backport features from Payara to GlassFish if we can find a better solution. But we at OmniFish are working on something similar, which would allow using references to environment variables in Meanwhile, we released the Docker image for 7.0.21, which allows running asadmin commands or a bash script from file before GlassFish is started. Here's the documentation: Execute asadmin commands before server startup. There's still a catch, GlassFish needs to be started, then commands executed, the GlassFish needs to be stopped, and then it will be started again as the main Docker process. There's a way to avoid it to speed up the container start, but it's not straightforward - from a bash script, start another bash script in background, which would wait until GlassFish is started and then would run the commands against the running server. This would not need a restart of GlassFish, as GlassFish would already be the main process. |
Im pretty happy to have a place where official glassfish docker images being published. However I was surprised to find no idea how to add environment properties for replacing domain.xml values. So basically, I cannot use the image without heavy lifting to make it work as a container with any kind of database for example. Maybe you can give me hint how to solve it in an intended way?
The text was updated successfully, but these errors were encountered: