-
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 parent directory permissions #619
Fix parent directory permissions #619
Conversation
bdef908
to
147f58a
Compare
147f58a
to
2a3a9a8
Compare
@@ -147,7 +158,10 @@ func TestSnapshotFiles(t *testing.T) { | |||
} | |||
defer os.Remove(tarPath) | |||
|
|||
expectedFiles := []string{"/", "/tmp", filepath.Join(testDir, "foo")} |
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.
I actually don't know why /
and /tmp
was included...
@dlorenc I updated the PR! |
RUN mkdir -p /home/user/foo | ||
RUN chown -R user /home/user | ||
RUN chmod 700 /home/user/foo | ||
ADD Makefile /home/user/foo/Makefile |
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.
Could you remove this line? We don't have a Makefile in the context which is causing the integration test build to fail.
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 line cannot be deleted because having ADD between chowns causes this issue. Is there any file available in the environment?
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.
Ah, maybe we can use some URL to download a file because it’s ADD. let me update the PR.
@dlorenc I updated the Dockerfile, please check it. |
Thank you for merging the PR! Do you have any plan to release new version? |
Id like to get #621 in then cut a release |
I found
chown
a directory after adding a file in it causes wrong directory owner and permission.My
Dockerfile
was something like below.I tried the Docker image built in Kaniko and checked the owner and permissions by
docker run -it IMAGE ls -l /home/user
, then I got the following result.I expect it to be:
I compared the built image with the one built by
docker build
, then I found the image layers ofdocker build
has parent directories if layers have newly added files.I think some Docker volume driver cannot update a file system if intermediate layers lost info of parent directories of a file.
Here's a similar issue in Docker (originally an issue of aufs).
moby/moby#1295