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

Bug: During the image pull down and unpack the file ownership is not changed if specified #82

Open
Jordan9500 opened this issue Nov 28, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Jordan9500
Copy link

Description of problem

When setting up a pod via Kata CC, and running it w/ Image-RS there is an issue with the transfer of ownership for files if the dockerfile specifically alters it.
For example if the dockerfile is:

FROM ubuntu:22.04

RUN mkdir -p /other
# Create bob user
RUN groupadd -g 1000 bob && useradd -g bob -u 1000 -s /bin/bash bob
RUN chown -v bob:bob /other;
USER bob

ENTRYPOINT [ "/bin/bash", "-c", "ls -al other" ]

Expected output

The resulting log output should be:

total 8
drwxr-xr-x 1 bob  bob  4096 Nov 17 13:33 .
drwxr-xr-x 1 root root 4096 Nov 17 13:52 ..

Actual output

However we end up getting:

total 0
drwxr-xr-x 1 root root 40 Nov 21 15:22 .
drwxr-xr-x 1 root root 80 Nov 21 17:02 ..

As shown the directory is still owned by just root, this should of been transferred to "bob".

Further information

I tested the kata environment across all the different areas as shown below in the table:

Runc Kata Kata CC w/ Image-rs Kata CC w/ Skopeo PeerPods (with skopeo) PeerPods (with image-rs)
Chown Test ✅ Pass ✅ Pass ❌ fail ✅ Pass ✅ Pass ❌ Fail

Could this be related to the unpack method currently being used here: https://github.com/confidential-containers/image-rs/blob/76e6abed950152f000d8f70026d11a86cf95fb0c/src/unpack.rs#L32-L34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants