Skip to content
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

Merged
merged 3 commits into from Apr 2, 2021

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Mar 29, 2021

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.

@stsewd stsewd requested a review from a team March 30, 2021 00:09
@@ -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``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: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``

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member

@ericholscher ericholscher left a 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``
Copy link
Member

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.

@stsewd stsewd enabled auto-merge (squash) April 2, 2021 00:02
@stsewd stsewd merged commit aa1da3f into master Apr 2, 2021
@stsewd stsewd deleted the allow-custom-user branch April 2, 2021 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants