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

strip file times to make tarballs more reproducible #126

Merged
merged 2 commits into from
Jan 22, 2020

Conversation

mxey
Copy link
Contributor

@mxey mxey commented Sep 26, 2019

No description provided.

@mxey
Copy link
Contributor Author

mxey commented Sep 26, 2019

I also think it would be sensible to strip all file modes except for executable, similar to Git. Should I add this?

@jdolitsky
Copy link
Contributor

@mxey sure that sounds good.. @shizhMSFT any thoughts on this?

@shizhMSFT
Copy link
Contributor

@mxey @jdolitsky File times are useful for many scenarios, especially for the scenario that we can use the uploaded directory (tar.gz) as a layer of a real image. Thus we should not strip file times.

@mxey
Copy link
Contributor Author

mxey commented Oct 17, 2019

File times are useful for many scenarios, especially for the scenario that we can use the uploaded directory (tar.gz) as a layer of a real image. Thus we should not strip file times.

@shizhMSFT the same could be said for UID and GID, which you already strip

@shizhMSFT
Copy link
Contributor

It is not stripping UID and GID but chown to root.

BTW, the scenario I have mentioned above can be found at https://github.com/sajayantony/dotnet-oci

@jdolitsky
Copy link
Contributor

Perhaps this is something we can pass as feature flag on push if necessary?

@mxey
Copy link
Contributor Author

mxey commented Oct 17, 2019

It is not stripping UID and GID but chown to root.

OK, in the same sense, I am not stripping times, I am just setting them to epoch 0

@mxey
Copy link
Contributor Author

mxey commented Oct 17, 2019

Perhaps this is something we can pass as feature flag on push if necessary?

That would work for me.

@jzelinskie
Copy link

jzelinskie commented Oct 17, 2019

We definitely should have parameters that clarify the manipulation of the tar headers. Different use cases will definitely have different requirements and may want the same tarball with different file attributes to be unique.

It's best to have an opinion, but leave a trapdoor. Make the easy things easy, and the hard things possible.

@mxey
Copy link
Contributor Author

mxey commented Nov 22, 2019

@jzelinskie So should I modify my pull request to make this into an option?

@jzelinskie
Copy link

I think so. What say you @jdolitsky?

@jdolitsky
Copy link
Contributor

@mxey @jzelinskie sorry for delay - yes that sounds good

@msftclas
Copy link

msftclas commented Jan 20, 2020

CLA assistant check
All CLA requirements met.

@mxey mxey requested a review from shizhMSFT January 20, 2020 14:17
@shizhMSFT shizhMSFT merged commit 93c4cc2 into oras-project:master Jan 22, 2020
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

Successfully merging this pull request may close these issues.

5 participants