-
Notifications
You must be signed in to change notification settings - Fork 144
run_code as a user instead of root #94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
run_code as a user instead of root #94
Conversation
This won't be probably backwards compatible right? Can I specify if I want run something as root? |
This comment was marked as outdated.
This comment was marked as outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we just need to be able to pass user
. Otherwise, someone might need to run something as root, leading to the same issue.
|
||
# Change ownership of all files to user | ||
RUN chown -R user:user $HOME | ||
|
||
USER user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are you doing it as last thing? If you would set the user as a first thing you probably don't need change the ownership
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem here is: "user" does not exist in python image
and we cannot add user before we have "sudo" dependency installed
so this is why it's the last
I created a new template, |
dockerfile = "e2b.Dockerfile" | ||
template_name = "code-interpreter-v1" | ||
template_id = "nlhz8vlwyupq845jsdg9" | ||
start_cmd = "sudo -u user /home/user/.jupyter/start-up.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one thing: this is a breaking change, should I put a script in /root/.jupyter/start-up.sh that just calls the actual start-up.sh with sudo -u user?
Sample code