title: Why java requires base image to run on docker
body: <p>I'm trying to understand why can't I run java inside docker container without having a base OS image.<br>
  I tried the next basic dockerfile:</p>
  
  <pre><code>FROM scratch
  
  ADD openjdk-11.0.2_linux-x64_bin.tar.gz /java
  
  CMD ["/java/jdk-11.0.2/bin/java", "-version" ]
  </code></pre>
  
  <p>And got the following error:</p>
  
  <pre><code>standard_init_linux.go:207: exec user process caused "no such file or directory"
  </code></pre>
  
  <p>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? </p>
  
  <p>In addition I'm interested to know what is that file <code>standard_init_linux.go</code>? does the linux kernel contains go code? </p>
  
  <p>I've found some resources about base images (below), but they still doesn't provide direct answer for my question.</p>
  
  <p><em>Resources</em></p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/38289509/docker-base-image">Docker: base image</a></li>
  <li><a href="https://www.redhat.com/en/blog/architecting-containers-part-1-why-understanding-user-space-vs-kernel-space-matters" rel="nofollow noreferrer">Architecting Containers Part 1: Why Understanding User Space vs. Kernel Space Matters</a></li>
  <li><a href="https://stackoverflow.com/questions/18786209/what-is-the-relationship-between-the-docker-host-os-and-the-container-base-image">What is the relationship between the docker host OS and the container base image OS?</a></li>
  </ul>