How to pass Java_opts before an executable to entrypoint in dockerfile?
You can declare environment variables with ENV
:
...
ADD --chown=daemon:daemon UserPrefExporter.sc /opt/docker
USER daemon
ENV JAVA_OPTS="-Xmx<limit>"
ENTRYPOINT ["./amm", "-h", "amm_home", "UserPrefExporter.sc"]
This post suggests using explicit exec
in ENTRYPOINT
:
ENTRYPOINT exec java $JAVA_OPTS