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
Build environment: allow to run commands with a custom user #8058
Conversation
59e362c
to
1e7d010
Compare
1e7d010
to
2255ac8
Compare
@@ -84,6 +83,8 @@ class BuildCommand(BuildCommandResultMixin): | |||
:param combine_output: combine stdout/stderr, default=True | |||
:param input_data: data to pass in on stdin | |||
:type input_data: str | |||
:param str user: User used to execute the command, it can be in form of ``user:group`` |
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.
:param str user: User used to execute the command, it can be in form of ``user:group`` | |
:param str user: user from inside the container to execute the command, it can be in form of ``user:group`` |
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.
This is the base class, not the docker implementation. But we use only the docker implementation, so don't know.
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.
Not sure what's best here. Either seems fine to me, given its on the base class.
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.
Pretty simple change 👍
@@ -84,6 +83,8 @@ class BuildCommand(BuildCommandResultMixin): | |||
:param combine_output: combine stdout/stderr, default=True | |||
:param input_data: data to pass in on stdin | |||
:type input_data: str | |||
:param str user: User used to execute the command, it can be in form of ``user:group`` |
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.
Not sure what's best here. Either seems fine to me, given its on the base class.
One step closer to allow running apt install. Confirmed that using setting the user as root is able to use apt after the container was created with other user, so all good.
Note: this user isn't being used in the "Local build command" as there isn't an option like that, we could change the command to execute
su {user} -c "{cmd}"
if we want to support local machines as build environments.