-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Non root docker #11323
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
Non root docker #11323
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,4 +13,14 @@ if [ "$1" = 'envoy' ]; then | |
| fi | ||
| fi | ||
|
|
||
| exec "$@" | ||
| if [ "$ENVOY_UID" != "0" ]; then | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the default here? If not set somehow by default should this default to "0"? I think by default we will enter this statement but the string will be empty?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thats correct. The default is to use the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where are these env variables set?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. they are runtime env vars for the container - so they can be set eg on the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not clear that this now has to be set. Can we please change this so that the default stays wat it was and we document how to set the right variables? By default I don't think this makes sense.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in the default case nothing should need to be set and all should work as it does now - save for the fact that process inside the container doesnt run as root. The cases where you would want to set these vars are:
my own opinion is that it is better to not run as root by default. Im happy to make whatever changes others feel necessary though
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If both of these env vars are empty strings which would be the defualt, do the commands even work?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep for sure. the default case is that in this case it goes into this code block, but as
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah OK, gotcha. Alright thanks for the explanation. LGTM. |
||
| if [ -n "$ENVOY_UID" ]; then | ||
| usermod -u "$ENVOY_UID" envoy | ||
| fi | ||
| if [ -n "$ENVOY_GID" ]; then | ||
| groupmod -g "$ENVOY_GID" envoy | ||
| fi | ||
| su-exec envoy "${@}" | ||
| else | ||
| exec "${@}" | ||
| fi | ||
Uh oh!
There was an error while loading. Please reload this page.