by While we can reduce the size of the base image of the operating system, for instance Alpine Linux which is only 5 MB, before Java 9 there was nothing we could do about the JRE.

Starting in Java 9, the JRE was broken up into modules, so that it became possible to only include the modules used by the application.

Run it to see: Now we come to the final step of stuffing it into a Docker image.

Since we wish to keep the image small, as a base image, we will use the alpine image which is just under 5MB.

Related Articles