I'm trying to understand why can't I run java inside docker container without having a base OS image.
I tried the next basic dockerfile:
FROM scratch
ADD openjdk-11.0.2_linux-x64_bin.tar.gz /java
CMD ["/java/jdk-11.0.2/bin/java", "-version" ]
And got the following error:
standard_init_linux.go:207: exec user process caused "no such file or directory"
In my understanding that's probably has something to do with unmet dependencies, but I still don't understand why I need all the user-space file system that comes with base images just to run a binary executable. aren't they supposed to run natively? what's the difference between binary that's able to run standalone and one that doesn't?
In addition I'm interested to know what is that file standard_init_linux.go
? does the linux kernel contains go code?
I've found some resources about base images (below), but they still doesn't provide direct answer for my question.
Resources