https://rancher.com/ logo
Title
w

wonderful-ability-35578

03/29/2023, 11:10 AM
One difference i am seeing is container in docker desktop starts in root whereas here its not and container start is failing with permission denied when chown is part of container start script
r

refined-analyst-8898

03/29/2023, 11:14 AM
What host os?
Are you saying the permission error originates in a pod you created in K3s that comes with Rancher Desktop?
Is the container trying to change owner of files in a mounted volume?
w

wonderful-ability-35578

03/30/2023, 6:46 AM
I am using macos and starting the containers via testcontainer When we start conatiner, we run few commands like chown, adduser, dpkg etc All this fails with root privileged required
r

refined-analyst-8898

03/30/2023, 12:08 PM
Your container runtime, e.g. Moby or containerd, will allow you to specify (override) the effective user to run the command inside the container. If you are using Java TestContainers library to run containers with Docker, then there is probably a way to configure the library to run a test container as root, or some other user, if that is your need. Alternatively, you may build a custom container image with a different default value for
USER
in the Dockerfile, and then that container will always try to run the container command as that
USER
.
w

wonderful-ability-35578

03/30/2023, 1:02 PM
Thanks @refined-analyst-8898
With testcontainer extra user privileged arguments pass resolved my issue