I have several Java services, each packaged as a separate jar file. I plan to package the as docker images. Do I need to bundle the Java runtime on each image, or can I rely on the fact the host (that will run the image) already has the Java runtime?
You could use a volume to mount the Java runtime from the host into the container, but this makes the container less portable (as Andrew Fox points out).
If instead you use a common base image such as java:8-jre
for your containers, the image will be shared between containers meaning that there is only one copy on disk (not one copy per container).
Not that in both cases, you will still have multiple JVMs running, one for each container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With