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

unpacking tools don't preserve mtime #74

Open
cyphar opened this issue Nov 5, 2016 · 3 comments
Open

unpacking tools don't preserve mtime #74

cyphar opened this issue Nov 5, 2016 · 3 comments

Comments

@cyphar
Copy link
Member

cyphar commented Nov 5, 2016

If you call image.CreateRuntimeBundleLayout twice on the same image with the same ref, all of the files will have different mtimes (and ctimes I also believe). You can check this with gomtree.

% oci-create-runtime-bundle --ref latest opensuse/ bundle1/
% sleep 30s
% oci-create-runtime-bundle --ref latest opensuse/ bundle2/
% gomtree -p bundle1/rootfs -c -K sha256digest > bundle1.mtree
"var/lib/ca-certificates/pem/930ac5d2.0": keyword "time": expected 1478385237.839344065; got 1478385246.227449545
"etc/pam.d/common-auth-pc": keyword "time": expected 1478385236.831331389; got 1478385245.223436920
"lib64/libnss_compat.so.2": keyword "time": expected 1478385236.927332596; got 1478385245.323438177
[ ... snip ... ]
% gomtree -f bundle1.mtree -p bundle2/rootfs
% echo $?
1

Note that I'm probably going to implement my own version of this unpacking functionality just so we can have more than one implementation of it, and then we can cross-verify bugs like this.

@vbatts
Copy link
Member

vbatts commented Mar 9, 2017

I'd say add a unit test for this, but also, who wants to own this?

@cyphar
Copy link
Member Author

cyphar commented Mar 9, 2017

Since umoci's oci/layer library fixes this, this will be fixed when oci/layer moves here. And umoci already has tests to deal with this case.

@cyphar
Copy link
Member Author

cyphar commented Jun 22, 2020

This project is no longer actively maintained. However, umoci is a much more full-featured tool for manipulating OCI images, and is now an OCI project as a reference implementation of the OCI image-spec. I would strongly suggest people move to using umoci.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants