openjdk-docker icon indicating copy to clipboard operation
openjdk-docker copied to clipboard

Slim JRE Docker images

Open dinogun opened this issue 6 years ago • 12 comments

Issue #72 related to adding JRE docker images in general which was done through PR #101. This issue deals with adding slim JRE images.

dinogun avatar Mar 27 '19 07:03 dinogun

Apologies to just jump in, but I came across this issue looking for a slim JRE build. It's a little dirty, but I did a first stab at this by starting with the slim JDK Dockerfile and slimming scripts and then updating slim-java.sh to:

  • not remove jre/bin in the jre_files function
  • duplicate the bin_files function to clean jre/bin as well
  • move over the jre folder instead of the root JDK folder
  • clean up the remaining JDK files

The reason I took that route was due to the JDK utilities (jar and jarsign in particular) being needed to perform some of the slimming tasks, so the standalone JRE couldn't just be used itself. With this, the image is down to 70.6 MB (as opposed to 89.7 MB for jdk-slim), though I'm sure that can be reduced a little further.

I've attached my changes below for review, but I'm also happy to file a pull request if you think this method of producing the slim JRE is okay.

slim-java.sh.txt

MPLew-is avatar Jun 10 '19 20:06 MPLew-is

@MPLew-is Can you submit that as a PR - easier for us to review :-)

karianna avatar Jun 11 '19 10:06 karianna

@MPLew-is This is great, thanks for picking this up ! As @karianna said, please submit a PR, we can do the review over there. Thanks

dinogun avatar Jun 11 '19 12:06 dinogun

Absolutely, I'll submit a PR in the next few days. So far I've only tested my slim build with JRE 8 and am still working on getting things integrated into your build system, so I'll get to work on that.

MPLew-is avatar Jun 11 '19 23:06 MPLew-is

I'm confused the status of slim images. I see slim stuff in master here, but don't see any slim images in Docker Hub. Could someone clarify please?

keeganwitt avatar Jul 18 '19 02:07 keeganwitt

The question of @keeganwitt is highly related to https://github.com/AdoptOpenJDK/openjdk-docker/issues/86 (Alpine based images).

bkleef avatar Sep 24 '19 09:09 bkleef

Sorry I missed the earlier comment from @keeganwitt. Official Docker images decided not to publish our slim images as they are not "official builds" from AdoptOpenJDK. i.e the AdoptOpenJDK build system does not generate the slim builds, instead we generate the docker images by stripping out content from the AdoptOpenJDK generated tarballs. Eg this script. Generating slim tarballs through the AdoptOpenJDK build process is still a todo.

dinogun avatar Sep 25 '19 12:09 dinogun

@dinogun is there a separated Github issue for generating slim tarballs as it looks like a block?

bkleef avatar Oct 05 '19 12:10 bkleef

@keeganwitt, @bkleef and @dinogun I opened an issue with the Adopt Build team to hopefully get support for slim builds. Feel free to comment over there to show your interest in the feature request.

james-crowley avatar May 26 '20 14:05 james-crowley

With Java 11+ we should be using link, jmod, package to create a 'blessed' Adopt slim image. For Java 8+ I'd recommend not creating a slim image - we want to move the industry forward to 11+

karianna avatar Mar 18 '21 11:03 karianna

For Java 8+ I'd recommend not creating a slim image - we want to move the industry forward to 11+

@karianna Are you suggesting (Not clear from 8+ in your post) that we actively stop updating the slim ones for java 8 that we already have?

sxa avatar Apr 01 '21 15:04 sxa

For Java 8+ I'd recommend not creating a slim image - we want to move the industry forward to 11+

@karianna Are you suggesting (Not clear from 8+ in your post) that we actively stop updating the slim ones for java 8 that we already have?

Not sure why I said that! :-| - I'll revert, we should offer slim 8 builds for those who need them.

karianna avatar Apr 19 '21 11:04 karianna