-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
fix: getUIDandGID is able to resolve non-existing users and groups #2106
Conversation
A common pattern in dockerfiles is to provide a plain uid and gid number, which doesn't neccesarily exist inside the os. Signed-off-by: Höhl, Lukas <[email protected]>
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.
In this case I'd love to have an integration test Dockerfile that chowns to a non-existent user, then checks later that it's owned by that user, even though that user doesn't exist. Do you think that's something we could add to this PR?
Otherwise, this looks great, and thank you so much for working on this! 👍
Signed-off-by: Höhl, Lukas <[email protected]>
Signed-off-by: Höhl, Lukas <[email protected]>
Signed-off-by: Höhl, Lukas <[email protected]>
I added a Dockerfile, is there something I need to configure inside the integration tests themself? |
Signed-off-by: Höhl, Lukas <[email protected]>
Signed-off-by: Höhl, Lukas <[email protected]>
@imjasonh This should be ready to go now, added some more tests for other functions involving the user retrieval process. |
github runner had the exact uid that i was testing on, so the groups were not empty Signed-off-by: Höhl, Lukas <[email protected]>
Signed-off-by: Höhl, Lukas <[email protected]>
Signed-off-by: Höhl, Lukas <[email protected]>
I'm currently stuck regarding an issue building this dockerfile Line 549 in 1395e46
Maybe a second pair of eyes can spot the mistake, since I don't know why this error appears. The error can't be reproduced on my WSL workstation, but appears in the github actions and mac running the integration tests. |
Signed-off-by: Höhl, Lukas <[email protected]>
Signed-off-by: Höhl, Lukas <[email protected]>
Signed-off-by: Höhl, Lukas <[email protected]>
Signed-off-by: Höhl, Lukas <[email protected]>
Great! |
Signed-off-by: Höhl, Lukas [email protected]
Fixes #1456
Description
A common pattern in dockerfiles is to provide a plain uid and gid number, which doesn't neccesarily exist inside the os.
Currently, an error accurs, specifying, that the user and group doesn't exist.
This PR changes the logic to lookup the users and groups only if the chown command can't be parsed into a valid uint32.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
Reviewer Notes
Release Notes
chown flag in Dockerfile COPY statement can specify non-existing user/group