-
Notifications
You must be signed in to change notification settings - Fork 594
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
feat(cnbBuild): support builders with different CNB user ids #4625
Conversation
/it-go |
883f738
to
6e588ed
Compare
/it-go |
6e588ed
to
c9e432b
Compare
/it-go |
c9e432b
to
fdb9d22
Compare
/it-go |
The Paketo Jammy builders changed the user id handling for security reasons, see https://github.com/orgs/paketo-buildpacks/discussions/188. To default to user root (and chown the working directory) jeopardizes this. Instead, use the docker options introduced once for the same topic here: caee8db |
This change is exactly for the purpose of supporting Jammy/non-Jammy builders simultaneously. On Jenkins we can not run as arbitrary user (which can be effectively anything in CNB), due to the fact that the user must match the UID of the JNLP container (or root), otherwise the Also this change lays down the ground for future support of the CNB Extensions, which require root privileges to invoke Kaniko builds during the extension phase. |
fdb9d22
to
7acbdb5
Compare
/it-go |
7acbdb5
to
c68c59b
Compare
/it-go |
That doesn't sound like Windows should be supported. How to ensure it? |
c68c59b
to
b17c45e
Compare
/it-go |
b17c45e
to
bc31e69
Compare
/it-go |
my only concern left is about the loss of windows as a testing platform. Btw: could we remove the dockeroptions, which were (afaiu) invented to pass login data to cnbBuild? Should be replaceable. |
If windows should be a testing platform or not, should not be decided on an individual pr where a windows user happened to the reviewer. That should be a goal of the project and the pre-commit checks should at least verify that it is compilable on windows. That is at least my opinion.
Which dockeroptions are you referring to? The one for strating |
|
the point is that this PR stops windows to be a platform for testing. officially, linux is the only platform supported, however there might be some people around which would appreciate windows support. |
Co-authored-by: Pavel Busko <[email protected]> Co-authored-by: Ralf Pannemans <[email protected]>
bc31e69
to
dbdb4f5
Compare
/it-go |
Kudos, SonarCloud Quality Gate passed! |
Co-authored-by: Ralf Pannemans <[email protected]>
Changes
The
cnbBuild
will read CNB user information from environment variables to enable support for Paketo Jammy builders.It enforces to run piper as root, the user for CNB lifecycle will be taken from the CNB_USER_ID and CNB_GROUP_ID. When the process is invoked, privileges are dropped down to this gid/uid.
Also this PR introduces two new features to the core packages:
RunExecutableWithAttrs
which allows to passsyscall.SysProcAttr
to the execution.Recursive
Chown
Tests
Documentation