-
-
Notifications
You must be signed in to change notification settings - Fork 7
feat: run container as non root user #33
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?
Conversation
|
hmm, damn, in my local tests this worked :( |
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
95fb55e to
a9dcd36
Compare
Pull request was converted to draft
a9dcd36 to
1b8227d
Compare
|
Just an idea: How about an entrypoint script that dynamically creates a user with the same UID and GID as the owner of the Here is a quick example from one of my dev containers: #!/bin/bash
export DEVUID=$(stat -c '%u' /repo/)
export DEVGID=$(stat -c '%g' /repo/)
export DEVUSER=voxbox$DEVUID
export DEVGROUP=voxbox$DEVGID
addgroup -S -g $DEVGID $DEVGROUP &>/dev/null
adduser -S -u $DEVUID -G $DEVGROUP $DEVUSER &>/dev/null
exec runuser -u $DEVUSER -g $DEVGROUP -- "$@" |
|
that could be a thing! we can try this |
37adad4 to
574131f
Compare
a533340 to
51b31f8
Compare
|
on my mac i dont have to add |
|
@defnull do you have any thoughts on this? Your solution is also okay. But when you run it like this and the group might already exist alpine ash will break. And we shouldn’t be needing cloning a user. The runtime should/could map this for us 🤔 |
|
Hm. Creating a fixed non-root user with UID=1000 should work fine in most single-user developer environments, but will break with permission errors if the host user (and thus the I see two solutions:
I can imagine that my example entrypoint breaks if the folder is owned by root (user or group) or a system user or group (<1000). In those cases, the |
|
okay, thx for the input. will try something tomorrow on the train. :D |
No description provided.