-
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
Support COPY --chown flag #962
Support COPY --chown flag #962
Conversation
5c42e63
to
d1e6c96
Compare
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.
@xanonid Thank you for your contribution.
The change looks really good. Can you please add some unit tests especially for the new function GetUIDAndGIDFromString
?
Thanks
Tejal
@xanonid Can you explain more on "This allows to build e.g. root-less containers more easily and avoids unnecessary additional layers from manual chown calls." ? |
cmd/executor/cmd/root.go
Outdated
@@ -200,7 +200,7 @@ func resolveDockerfilePath() error { | |||
// copy Dockerfile to /kaniko/Dockerfile so that if it's specified in the .dockerignore | |||
// it won't be copied into the image | |||
func copyDockerfile() error { | |||
if _, err := util.CopyFile(opts.DockerfilePath, constants.DockerfilePath, ""); err != nil { | |||
if _, err := util.CopyFile(opts.DockerfilePath, constants.DockerfilePath, "", -1, -1); err != nil { |
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.
lets make the two integers into constants so that their meaning is more clear to readers
34d3ca8
to
2439a1a
Compare
Thanks @xanonid Looks like there is conflict due to a my PR that went in before. I will try to pick this up and get it in this release. |
2439a1a
to
91dfa48
Compare
91dfa48
to
0c6f6b7
Compare
0c6f6b7
to
d500962
Compare
d500962
to
31f626c
Compare
I just bumped into this issue and was very happy to find this PR, being merged and all, nice work! However, it made it to I will use a |
@anton-johansson @tejal29 0.18.0 was released some days ago. Unfortunately, the change by this PR is not mentioned in the release notes. |
If this takes too long to release, I don't mind creating a quick PR to mention in documentation that |
@Misteur-Z This PR is merged and released, so |
This PR fixes #9, #550, #579
Description
This PR adds the --chown flag to kaniko. This allows to build e.g. root-less containers more easily and avoids unnecessary additional layers from manual
chown
calls.The PR does not yet contain integration tests as the container-diff cannot yet check file ownership (GoogleContainerTools/container-diff#308).
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
kaniko supports now the --chown flag for the COPY command.