<p>Trying to exec into a container with the following command</p>
<p><code>kubectl exec -it my-pod my-container1 -- bash</code></p>
<p>Gives error:</p>
<blockquote>
<p>OCI runtime exec failed: exec failed: container_linux.go:367: starting container process caused: exec: &quot;my-container1&quot;: executable file not found in $PATH: unknown
command terminated with exit code 126</p>
</blockquote>
<p>The pod <em>my-pod</em> has two containers. And <em>my-container1</em> has alipne image with bash installed.
Trying to get shell into the container, it is not able to find bash.</p>
<p>Kubectl client version: v1.17.0</p>

RMNull
<p>Adding -c before the container name worked.</p>
<p><code>kubectl exec -it my-pod -c my-container1 -- bash</code></p>
