builder/dockerfile: ADD with best-effort xattrs#47175
Conversation
|
Thinking of this; I wonder if we're trying too much here. While we could copy these attributes; they may not be portable when pushing the image. ISTR there even was code that explicitly excludes xattrs (with a limited set of allowed ones) for portability 🤔 (but I'd have to dig where). So perhaps we shouldn't even do so; otherwise we may end up with attributes that are available locally, but that get discarded after pushing / pulling the image. Here's some prior tickets / comments that seem relevant related to that;
|
|
We've been copying xattrs when |
b647e79 to
ab6d760
Compare
tonistiigi
left a comment
There was a problem hiding this comment.
Doesn't this affect the pull flows as well (and load, import, build context transfer in legacy builer etc)? Does it make sense to add new WithBestEffortXattrs rather than just restoring the old xattr behavior.
Archives being unpacked by Dockerfiles may have been created on other OSes with different conventions and semantics for xattrs, making them impossible to apply when extracting. Restore the old best-effort xattr behaviour users have come to depend on in the classic builder. The (archive.Archiver).UntarPath function does not allow the options passed to Untar to be customized. It also happens to be a trivial wrapper around the Untar function. Inline the function body and add the option. Signed-off-by: Cory Snider <[email protected]>
|
Adding a parameter—even a variadic one—is an API breaking change, and therefore would be unsuitable for backporting to v25. I'm going to rewrite this PR to not touch the pkg/archive API |
ab6d760 to
5bcd2f6
Compare
Archives being unpacked by Dockerfiles may have been created on other OSes with different conventions and semantics for xattrs, making them impossible to apply when extracting. Restore the old best-effort xattr behaviour users have come to depend on in the classic builder.
Buildkit will need to opt into best-effort xattr behaviour separately.
- What I did
- How I did it
- How to verify it
TODO regression test
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)