title: Why can run Java program manually in a Docker image but not as an ENTRYPOINT
body: <p>I created an openjdk-11 alpine docker image and copied my jar into it. My Dockerfile is like this:</p>
  
  <pre><code>FROM pwittchen/alpine-java11
  VOLUME /tmp
  ARG JAR_FILE
  COPY ${JAR_FILE} /opt/app.jar
  ENTRYPOINT ["java", "-jar", "/opt/app.jar"]
  </code></pre>
  
  <p>If I run:</p>
  
  <pre><code>docker run -it image
  </code></pre>
  
  <p>then</p>
  
  <pre><code>Error loading shared library libjli.so: No such file or directory (needed by /usr/local/share/jdk-11/bin/java)
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_Launch: symbol not found
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_PreprocessArg: symbol not found
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_ReportMessage: symbol not found
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_StringDup: symbol not found
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_MemFree: symbol not found
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_InitArgProcessing: symbol not found
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_AddArgsFromEnvVar: symbol not found
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_List_add: symbol not found
  Error relocating /usr/local/share/jdk-11/bin/java: JLI_List_new: symbol not found
  </code></pre>
  
  <p>But if:</p>
  
  <pre><code>docker run -it --entrypoint /bin/sh image
  </code></pre>
  
  <p>Then I can execute directly in the shell:</p>
  
  <pre><code>$ java -jar /opt/app.jar
  </code></pre>
  
  <p>And works. </p>
  
  <p><strong>Why running as ENTRYPOINT makes the libjli.so library shadow and try relocating JLI*?</strong></p>