1 year ago
#335301
TheAkashKamble
Not able to change JVM options ( xmx, xms etc. ) with openjdk:8 based docker container
I am trying set xmx and xms parameters for my java application which is inside docker container. When I try with adoptopenjdk it works fine.
With AdoptOpenjdk
Dockerfile :
FROM adoptopenjdk/openjdk8-openj9:alpine
WORKDIR /
ADD /target/*.jar app.jar
...
Docker compose
myapp:
image: myapp:dev
container_name: myapp
network_mode: "host"
ports:
- "PORT:PORT"
environment:
- OPENJ9_JAVA_OPTIONS=-Xmx1400m -Xms1400m -XX:+UseContainerSupport
But the same thing is not working with openjdk:8
Dockerfile
FROM openjdk:8
WORKDIR /
ADD /target/*.jar app.jar
...
Docker Compose file
myapp:
image: myapp:dev
container_name: myapp
network_mode: "host"
ports:
- "PORT:PORT"
environment:
- JAVA_OPTS=-Xmx1400m -Xms1400m -XX:+UseContainerSupport
java
docker
adoptopenjdk
0 Answers
Your Answer