docker-library/tomcat

Remove src.zip from JDK installation

ridoo opened this issue · 5 comments

ridoo commented

After installing the JDK the src.zip resides within ${JAVA_HOME}/lib/src.zip. Normally, the source are bound to the IDE during development and should not be necessary in Docker images. Removing it would reduce size by ca 60MB. At least for slim versions it would be nice to save some space here.

I am using tomcat:9.0-jdk11-openjdk-slim

ridoo commented

Thanks @wglambert for linking docker-library/openjdk#282, did not see that before.

However, it seems to raise the same issue, but (IMHO) from a different user context. I can see the argument that one cannot forsee if users need the src.zip from the openjdk image or not. In this case, I also would leave it where it is. In the tomcat image, however, users actually really do not need the sources from within the scope the tomcat image provides (just run webapps).

Note: The tomcat image is not based on the openjdk image itself, but directly downloads and installs it from github.com/AdoptOpenJDK.

Note: The tomcat image is not based on the openjdk image itself, but directly downloads and installs it from github.com/AdoptOpenJDK.

I'm confused by this -- every tag of this image is FROM one of the tags of openjdk, adoptopenjdk, or amazoncorretto, depending on the variant? Do you have a link to a counterexample? 😬

Even more explicitly, here's every FROM value in this repository (deduplicated):

adoptopenjdk:8-jdk-hotspot
adoptopenjdk:8-jdk-openj9
adoptopenjdk:11-jdk-hotspot
adoptopenjdk:11-jdk-openj9
amazoncorretto:8
amazoncorretto:11
openjdk:8-jdk-buster
openjdk:8-jdk-slim-buster
openjdk:11-jdk-buster
openjdk:11-jdk-slim-buster
openjdk:15-jdk-buster
openjdk:15-jdk-oraclelinux7
openjdk:15-jdk-slim-buster

So anywhere we've got src.zip, it's coming from our upstream image and removing it here won't actually save any space (due to how Docker's layering works). 😕

ridoo commented

@tianon seems to be my fault. I was referring to what I found on Docker Hub.

I should have checked the Dockerfiles in the repository :(. Sorry for the confusion.

Going to close with what was said in docker-library/openjdk#282 (comment)