activemq-artemis icon indicating copy to clipboard operation
activemq-artemis copied to clipboard

ARTEMIS-3983 Change docker base image version from JDK to JRE

Open ViliusS opened this issue 3 years ago • 6 comments

JRE is enough to run most Java software, including ActiveMQ Artemis.

ViliusS avatar Sep 03 '22 14:09 ViliusS

I guess we would lose JDK diagnostic tools. What are the benefits to change base image from JDK to JRE?

brusdev avatar Sep 07 '22 19:09 brusdev

Smaller uncompressed image size on disk.

I guess the decision depends on how these docker images are seen. Are they for development of Artemis itself, or to easy development of software using Artemis, or as a base images for production?

For Artemis development yes, JDK diag tools could be useful. For other purposes, I doubt so.

ViliusS avatar Sep 07 '22 21:09 ViliusS

Ill let others discuss merits of jdk vs jre ... but this would require a jira, this isnt a small typo or doc fix.

michaelandrepearce avatar Sep 07 '22 21:09 michaelandrepearce

@ViliusS, can you quantify the difference this will make in the size of the image?

For what it's worth, lots of folks use JDK tools during development and production (e.g. when issues arise). It can be really convenient to have them around when things go badly.

jbertram avatar Sep 16 '22 01:09 jbertram

The difference is 250MB vs 450MB.

I would agree that running Artemis in development JDK tools could be needed, but I don't agree that including these tools in production (even if needed sometimes) is good idea. Generally production images should be as slim as possible to reduce attack surface, size for fast deployment, etc. etc. If debugging in production is needed one can always use tools like "kubectl debug" which allows to map another container with tools, side by side.

Maybe it is better to have two Dockerfiles then, one for development and one for production, clearly marked? If you think that would be better, I can adjust PR. Also it's probably wise to forgo Debian image as it is built against deprecated openjdk image which is not updated anymore https://github.com/docker-library/openjdk/issues/505

ViliusS avatar Sep 16 '22 05:09 ViliusS

@ViliusS I think having the option to choose JRE or JDK would be great since one size doesn't fit all in this case.

jbertram avatar Sep 16 '22 15:09 jbertram

Save 200MB would be great, +1 on having two Dockerfiles

brusdev avatar Sep 17 '22 19:09 brusdev

OK, I have added JRE option as a separate Dockerfile.

I have also removed Debian image which used now deprecated OpenJDK build, and converted CentOS image to also use Eclipse-Temurin. Previous jboss/base-jdk image was not updated for the past 2 years.

Hopefully this will satisfy everyone.

ViliusS avatar Sep 18 '22 18:09 ViliusS