<p>I have used &quot;bitnami/kubectl:latest&quot; image to my test container which runs inside a test pod. I just login to that container and I wanted to create a file inside that container. But ended up with below error.</p>
<pre><code>I have no name!@test:/$ touch test
touch: cannot touch 'test': Permission denied
I have no name!@test:/$ mkdir test
mkdir: cannot create directory 'test': Permission denied
</code></pre>
<p>Can someone help me to understand why this problem occurs and how to fix this? I am aware that mounting the file as configmap might help me but just I need to understand this issue. Thanks in advance!</p>

anonymous user
<p>The issue here is that the docker image which you are using is configured to run its final instruction using a non-root user (<code>USER 1001</code> in this case).</p>
<p>Have a look at the Dockerfile instruction:
<a href="https://github.com/bitnami/bitnami-docker-kubectl/blob/master/1.24/debian-11/Dockerfile#L24" rel="nofollow noreferrer">https://github.com/bitnami/bitnami-docker-kubectl/blob/master/1.24/debian-11/Dockerfile#L24</a></p>
<p>So you can either</p>
<ul>
<li>create files in a non-root user owned directory like <code>/tmp</code> or</li>
<li>create your own docker image after removing that <code>USER 1001</code> instruction from the Dockerfile and host it in your own repository which can then be pulled into your cluster.</li>
</ul>
<p>Whatever works for you.</p>
<p>Hope this helps!</p>
