I am trying to pass JAVA_OPTS to my entrypoint but all syntax that I have tried isn't working. Here is my code:
ENTRYPOINT ["java", $JAVA_OPTS, "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8008", "-cp","app:app/lib/*","gov.aus.mkt.data.MktApp", "--spring.redis.host=redis"]
Is there any way to pass $JAVA_OPTS
from environment variable defined on docker-compose?
While I was searching on internet, I also find some posts about being a bad practice use entrypoint as I am doing. What is the "right" way and why?
edit:
Solved it using explicit exec:
ENTRYPOINT exec java $JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8008 -cp app:app/lib/* gov.aus.mkt.data.MktApp --spring.redis.host=redis
Is it a good practice? Why?