<p>My Dockerfile</p>
<pre><code>FROM maven:3.5-jdk-8 AS build  
COPY src /usr/src/app/src  
COPY pom.xml /usr/src/app  
RUN mvn -f /usr/src/app/pom.xml clean package

FROM gcr.io/distroless/java:debug

COPY --from=build /usr/src/app/target /usr/app/target
COPY --from=build /usr/src/app/src /usr/app/src
EXPOSE 8080
ENTRYPOINT [&quot;java&quot;, &quot;-cp&quot;, &quot;/usr/app/target/classes:/usr/app/target/dependency-jars/*&quot;, &quot;com.salesforce.Main&quot;]  
</code></pre>
<p>Local MacBook Docker container java version</p>
<pre><code>openjdk version &quot;1.8.0_275&quot;
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-1~deb9u1-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)
</code></pre>
<p>Kubernetes Pod java version</p>
<pre><code>openjdk 11.0.9.1 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-post-Debian-1deb10u2)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-post-Debian-1deb10u2, mixed mode)
</code></pre>
<p>Rationale: My understanding of the Docker container means that if we specify the same docker tag we should be able to get the same version of Java both in Local Mac and K8s Cluster. But I didn't get it.</p>
<p>Does anybody have a logical explanation of this behaviour?</p>

Dinesh
<p>The base image you are using <code>gcr.io/distroless/java:debug</code>, seems to be updated 3 days ago and the tag <code>debug</code> won't guarantee the same java version if there are updates in b/w the time you pulled it on your machine and in the container.</p>
<p>In order to ensure java version, use a versioned debug tag e.g <code>gcr.io/distroless/java:8-debug</code> for Java 8 or <code>gcr.io/distroless/java:11-debug</code> for Java 11</p>
