AdoptOpenJDK / openjdk-docker

Scripts for creating Docker images of OpenJDK binaries.

Home Page:https://hub.docker.com/_/adoptopenjdk/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Additional files to remove from Slim JDK/JRE builds

srbala opened this issue · comments

There are few more files/folder to consider to remove from JDK/JRE Builds. This drops additional 50MB+

/opt/java/openjdk/src.zip 
/opt/java/openjdk/demo --for hotspots
/opt/java/openjdk/include 
/opt/java/openjdk/man 
/opt/java/openjdk/sample 

I am not sure /opt/java/openjdk/lib/ct.sym can be added to the list.

Looking see this issue implemented. Is outside contribution allowed?

@srbala Adopt is a open source project, there is no outside or inside :) You are absolutely welcome to contribute !

@dinogun @karianna
I am looking into work on fix. Here in my analysis prior to start the work.

  • Existing slim-java script contains the step to remove src.zip file, but script is not executed/called for centos, clefos, ubi, ubi-minimal etc
  • It is possible to save 12-15MB more if multi stage build step is used, where binutils package can be skipped. Please note multi-stage build gives better results compare to removing binutils. In fact some of the os ubi for example has negative impact, slight increase in size on remove packages.
  • Remove include folder and other text files like 3RDPARTY/legal can save another 1MB, can they be included in remove list?
  • It is possible to save 12-15MB more if multi stage build step is used, where binutils package can be skipped. Please note multi-stage build gives better results compare to removing binutils.
    @dinogun @karianna, your input on multi-stage build?
  • I think src can go as you suggest for slim
  • I'm not 100% binutils is safe to remove.
  • Legal would need to remain.

@karianna

  • I think src can go as you suggest for slim

alpine-slim and ubuntu-slim scripts already removes src.zip, my PR will help to remove for other OSs.

  • I'm not 100% binutils is safe to remove.

Existing alpine-slim and ubuntu-slim scripts install bintools prior to run slim-java script and removes it after script complete.
image

  • Legal would need to remain.

Since bintools only added for slim image and the package removed after it, it was never in the container image. bintools is not a legal issue. But, It might be for removing the 3rd-party files and text, attributes to size of 1MB.

@dinogun I have noticed Jenkins script using docker plugin command. Is multi stage build is allowed in the verion of docker on the build server. is the docker version 19.x and above or podman 2.x and above?

Using multi stage build in Dockerfile? It can save another 13-15MB space.