<p>I logged into Kubernetes etcd pod</p>
<pre><code>kubectl exec -it -n kube-system etcd-master -- /bin/sh
</code></pre>
<p>I cannot figure out what OS is it.</p>
<p>ls does not work</p>
<pre><code>sh-5.0# ls
sh: ls: command not found
</code></pre>
<p>cat does not work</p>
<pre><code>sh-5.0# cat /etc/os-release
sh: cat: command not found
</code></pre>
<p>apt,yum not recognized</p>
<pre><code>sh-5.0# apt
sh: apt: command not found

sh-5.0# yum
sh: yum: command not found
</code></pre>
<p>I can only cd and list files via pattern expansion</p>
<pre><code>sh-5.0# cd /etc
sh-5.0# echo *
debian_version default dpkg group host.conf hostname hosts issue issue.net kubernetes network nsswitch.conf os-release passwd profile.d protocols resolv.conf rpc services skel ssl update-motd.d

sh-5.0# echo `&lt;os-release`
PRETTY_NAME=&quot;Distroless&quot; NAME=&quot;Debian GNU/Linux&quot; ID=&quot;debian&quot; VERSION_ID=&quot;9&quot; VERSION=&quot;Debian GNU/Linux 9 (stretch)&quot; HOME_URL=&quot;https://github.com/GoogleContainerTools/distroless&quot; SUPPORT_URL=&quot;https://github.com/GoogleContainerTools/distroless/blob/master/README.md&quot; BUG_REPORT_URL=&quot;https://github.com/GoogleContainerTools/distroless/issues/new&quot;
</code></pre>
<p>What operating system is it? How to install bash here?</p>

Grzegorz Wilanowski
<p><code>/etc/os-release</code> states that the image is based on <code>Distroless</code>. The <a href="https://github.com/GoogleContainerTools/distroless/blob/master/README.md" rel="nofollow noreferrer">SUPPORT_URL</a> given there explains that:</p>
<blockquote>
<p>&quot;Distroless&quot; images contain only your application and its runtime dependencies.
They do not contain package managers, shells or any other programs you would expect to find in a standard Linux distribution.</p>
<p>For more information, see this <a href="https://swampup2017.sched.com/event/A6CW/distroless-docker-containerizing-apps-not-vms?iframe=no&amp;w=100%&amp;sidebar=yes&amp;bg=no" rel="nofollow noreferrer">talk</a> (<a href="https://www.youtube.com/watch?v=lviLZFciDv4" rel="nofollow noreferrer">video</a>).</p>
</blockquote>
<p>This is one of the best practices with containers to leave only what is absolutely necessary inside. You may encounter many such images and some even won't have <code>sh</code> in it. Moreover, root filesystem can be read only and/or the container might not have enough privileges to install things.</p>
<p>With all this in mind, it may be so that you will not be able to bring <code>bash</code> or anything else inside. Depending on your actual goal, you may:</p>
<ol>
<li>Try to copy files out of the container with <code>kubectl cp</code> (requires <code>tar</code> inside the image);</li>
<li>Get into the host node of the container and locate container files on the host. You may as well use <code>docker cp</code> on the host to push <code>bash</code> binary inside the running container.</li>
</ol>
