Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Change java options of socks shop #16

Closed
stefanodoni opened this issue Nov 2, 2016 · 5 comments
Closed

Change java options of socks shop #16

stefanodoni opened this issue Nov 2, 2016 · 5 comments
Assignees

Comments

@stefanodoni
Copy link

Hi,

Would it be possible to change the java options for the java-based microservices?

I would like to experiment with the various memory settings (i.e. -Xmx etc.).

Thank you!

@pidster
Copy link
Contributor

pidster commented Nov 2, 2016

We can't use variables inside the ENTRYPOINT declaration of the Dockerfile.
We could use an /entrypoint.sh script that handles variables set in the environment & passed into the container launch.

Would you like to have a try at a PR for this?

@philwinder
Copy link
Contributor

Hi @stefanodoni,
Alternatively, you can simply edit the dockerfile, rebuild and use.

https://github.com/microservices-demo/orders/blob/master/docker/orders/Dockerfile#L6

But longer term, yes, a PR with support for JAVA_OPTS as an env var would be more flexible.

@stefanodoni
Copy link
Author

Hi Phil,

What's the best way to include support for JAVA_OPTS?

A quick & dirty approach I have used is through a custom script that then
sources the env var, i.e.:

ENTRYPOINT ["/opt/dacapo/java.sh", "-jar",
"/opt/dacapo/dacapo-9.12-bach.jar"]

$ cat java.sh
#!/bin/sh

java $JAVA_OPTS $*

I'm not sure if there are better ways to achieve this?

Thanks

On 2 November 2016 at 13:25, Phil Winder [email protected] wrote:

Hi @stefanodoni https://github.com/stefanodoni,
Alternatively, you can simply edit the dockerfile, rebuild and use.

https://github.com/microservices-demo/orders/blob/master/docker/orders/
Dockerfile#L6

But longer term, yes, a PR with support for JAVA_OPTS as an env var would
be more flexible.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#16 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AOh0lVysYoBPhlgXRzsAmQWrhk9JvMCvks5q6IEjgaJpZM4KnI2V
.

Stefano Doni
Mobile +39 348 9691385
[email protected]

Moviri SpA
http://www.moviri.com
via Schiaffino 11
20158 Milano MI
Italy

@pidster
Copy link
Contributor

pidster commented Nov 7, 2016

Actually @philwinder, this now makes me think we should create a common base image that does this for all of the Java based containers. Also, the standard Spring springboot bash script handles JAVA_OPTS, which could then be added to the Dockerfile as an ENV declaration.

@nustiueudinastea
Copy link
Contributor

This issue has been fixed and all the java based services can now be configured using the JAVA_OPTS environment variable.

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

No branches or pull requests

4 participants