-
Notifications
You must be signed in to change notification settings - Fork 95
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
How to use sudo to execute commands as root #19
Comments
Hi, Since the images are setup with the idea of being temporary, and to try and protect users from accidentally impacting their host machine, you can't use sudo with the images. The idea was to make the image capable of doing a build using bitbake, but all other items of work would be done on the host (editing files, etc), outside of the container. There are a few ways that you could change this if you really wanted this behavior, such as modifying the sudoers file and building the image yourself, or using "docker exec" to explicitly login as the root user to a running container. If not having sudo access is really impacting your ability to use the image, then posting more details about what you're trying to accomplish may allow someone to offer suggestions to alternatives. |
@rewitt1, having a similar need here too. It relates to NPM is not being installed and is required for barys (as suggested by here https://resinos.io/docs/custombuild/) I agree with your mindset here, i'll try to work around it using For those interested, I ran
|
Hi @jaredwolff, Since you would have to run that command each time you used the image, or create an actual container from it, would it be better to just build your own image and add the "apt-get install" for npm to the Dockerfile? If that isn't the case, I'm curious to learn why you would lean more toward using "docker exec". Understanding different use patterns is always helpful. Edit
|
Ohh @rewitt1, I'm still learning the ins-and-outs of Docker. So excuse my ignorance. I was just going by what you suggested earlier. I'll go by what you suggest here and build my own image that way. Thanks for the input! |
Quick addition: Getting an error with the
|
I'm having the same issue as above. If I remove the --workdir parameter it works but the workdir is owned by root. And I do not know the root password in the container. |
@sujeethk and @jaredwolff, I added a new issue, #20. I think it addresses what you are seeing. Please feel free to comment in #20 if it doesn't. |
Closing, since there is no issue to fix. |
I think one area that may be problematic is the network setup with |
Hello,
For pokyuser, can I use sudo commands likes root?
how about pokyuser pwd?
Thank you!.
The text was updated successfully, but these errors were encountered: