Closed grantmacken closed 6 years ago
Sounds reasonable to me, but again I would have to defer to @duncdrum as this is getting outside of my Docker "knowledge zone"
The JAVA_TOOL_OPTIONS
do not depend on the host environment, they should be present when folks use these images on CI servers for example without docker-compose. they really make the interaction between JVM (the distroless one) and docker a lot more stable.
they also enable some convenience functions when building custom images.
We can add them to docker-compose which will take precedence over the ones in the Dockerfile, but I don't think removing them from the Dockerfile is a good idea.
The JAVA_TOOL_OPTIONS do not depend on the host environment.
I'm not much of a java person, I didn't know they were a thing until a few weeks ago. Anyway my thoughts were, if you are going to set something like
-Dorg.exist.db-connection.cacheSize=${CACHE_MEM:-256}M\
then setting the cache size would depend your cloud hosting env in which the container runs. If this is the case, maybe we shouldn't set it as a default in the build, but suggest the user set it at runtime. After rereading the README, I see one of the limitations in Distroless land, is that env vars can't be set at runtime. You should be able to pass these -Dxxx --XX args to java via the ENTRYPOINT which you can override at runtime.
At the moment the Java runtime args are set in the dockerfile as the build env. I think it would be best to leave these out as they depend on the host environment. Instead use docker-compose to set these.