As docker is not an operating system, no there's no JDK for docker.
As I understand your question, it's that a full JDK is too large for your wishes, in this case you may try switching to just the JRE and include only necessary libraries.
JDK is the acronym of Java Development Kit, JRE is the one for Java Runtime Engine. By "lazyness" due to the complexity to list every needed dependency no one strip down to the necessary libraries only, but that is the way to go if you wish to reduce the installed size to strict minimum.
A more usable way could be strip off some of the installed things which are taking a lot of space:
/usr/lib/jvm/jdk1.8.0_101$ du -hs *
776K bin
4.0K COPYRIGHT
5.7M db
208K include
4.9M javafx-src.zip
187M jre
133M lib
4.0K LICENSE
2.0M man
4.0K README.html
4.0K release
21M src.zip
108K THIRDPARTYLICENSEREADME-JAVAFX.txt
176K THIRDPARTYLICENSEREADME.txt
There's two *src.zip which can be removed, they won't be of use, and as you can see the lib directory is half the size and within it you have a bunch of things you don't really need:
/usr/lib/jvm/jdk1.8.0_101$ du -hs lib/*
120K lib/amd64
1.2M lib/ant-javafx.jar
18M lib/ct.sym
160K lib/dt.jar
20K lib/ir.idl
36K lib/javafx-mx.jar
400K lib/jconsole.jar
12K lib/jexec
60M lib/missioncontrol
4.0K lib/orb.idl
8.0K lib/packager.jar
2.4M lib/sa-jdi.jar
18M lib/tools.jar
34M lib/visualvm
You can without problem remove missoncontrol on a server, I assume you can get rid of visualvm also, you'll have to check if you need something in this lib directory, but I can't tell without knowing your app..
One thing you should do in your dockerfile while installing oracle jdk is to remove the downloaded .tar.gz
file which is roughly the same size as the resulting directory as .jar
files are already compressed, the tar.gz is just there to "package" them.
You have to do all this in the same RUN
command, chaining with &&
to avoid adding layers where you won't remove size by removing files from previous layer.