<p>I can read out the images metadata with docker inspect.</p>
<p>But</p>
<ol>
<li>in an kubernetes environment - is there a way to get the defined entrypoint of an image with kubectl commands?</li>
<li>is it possible to find the entrypoint in a shell/bash console of the running container?</li>
</ol>
<p>I looked around with kubectl commands, describing deployments, pods, but if the &quot;command&quot; and/or &quot;args&quot; value was not overridden by a kubernetes yaml, i was not able to find the dockerfiles entrypoint.</p>

spkd
<p>I don't think this information is reliably available in any way other than inspecting the Dockerfile or <code>docker inspect</code>ing a built image.</p>
<p>Kubernetes will not update a Pod's status or anything else in the Kubernetes API with metadata about the image, except for including the SHA-256 hash of the image that's actually being used.  There's no way to get this information back via <code>kubectl</code>; Kubernetes simply doesn't have it.</p>
<p>It's probably not available in a debugging shell either (if it's even possible to get one; some images don't include a shell for size and security reasons).  If you can get a shell, and if you have core tools available, then <strong>ps</strong>(1) could show you the command line for the process with process ID 1; but if the image has an entrypoint wrapper script that ends with <code>exec &quot;$@&quot;</code>, that will replace the entrypoint process with the <code>CMD</code> process.  If you can get that command line, it will include the entrypoint and command strings combined together.</p>
<p>The most common case of actually needing to know this is to want to further wrap an entrypoint wrapper with custom setup, then <code>exec</code> the original entrypoint.  You do need to do something like <code>docker inspect</code> the image to find out what the entrypoint value was; it is not going to be visible anywhere in Kubernetes deployment YAML.</p>
