In the examples i saw, the clara docker image runs as root. I wonder if it is possible to run it as a specific user? The reason for asking is that while running code; any changes i do inside docker, gets reflected as root on host also. This is somewhat inconvenient.
Thanks for your question. I agree it is annoying. To avoid that you need to know your user id on the host using
then inside the docker you should create a user with same id then su to it using
useradd -m -u <your_user_id> -s /bin/bash <your_user_name> su <your_user_name>
hope that helps
Thank you for your reply. I think there is some bigger problem when the code is on git. the files are suddenly marked at root and git gets messed up.
What you say does make sense but however this commend is run inside the docker, when all the file systems have been mounted.
Just to tell you what i exactly want, when i launch the tensorflow docker, the message comes below. i tried with clara docker but i get some id doesn’t exists error. Am i doing something wrong?
WARNING: You are running this container as root, which can cause new files in mounted volumes to be created as the root user on your host machine.
To avoid this, run the container by specifying your user’s userid:
docker run -u (id -u):$(id -g) args…
I am not sure why gitclone would mount files as root. You should have all the files on your local host with your user as the owner.
May be try to download the notebooks as a zip file and extract them
in any case what you suggested is another way to have the files written as your user when you train. you can do this by uncommenting the line in the startDocker.sh clara-train-examples/startDocker.sh at master · NVIDIA/clara-train-examples · GitHub
Just FYI we commented this option as some notebook functionalities needed to run as root like installing plugins, running AIAA notebook and FL notebooks since that needed to open ports. Also I think there was another issue with Jupyter lab but I forgot what it was may be it was running the tensorboard
Hope that helps
Thanks for reply; i myself am not sure about the git behaviour; maybe i did something wrong. usually i have byobu and multiple tabs. one tab runs the docker and the others for editing checking etc.
also, thanks for explaining the reasoning.