Skip to content

Conversation

@akatsukilelouch
Copy link

previously it just considered compressed data as archives but docs specify that plain uncompressed tar is also supported but it was not.

per documentation:

REQUEST BODY SCHEMA: application/octet-stream

A tar archive compressed with one of the following algorithms: identity (no compression), gzip, bzip2, xz.
string <binary>

when using docker API the http context containing was never extracted if it was plain tar. some libraries and clients send plain tar, but that fails when using buildkit.

previously it just considered compressed data as archives
but docs specify that plain uncompressed tar is also supported
but it was not.

Signed-off-by: akatsukilelouch <[email protected]>
{0x42, 0x5A, 0x68}, // bzip2
{0x1F, 0x8B, 0x08}, // gzip
{0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00}, // xz
{0x2E, 0x2F, 0x2E, 0x2F}, // tar (pax or ustar extended with headers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a valid way to detect uncompresed tar. First is just ././ and "ustar" does not appear in the beginning of a file.

Copy link
Author

@akatsukilelouch akatsukilelouch Dec 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry, I've forgotten how tar stores files. I had a specific use-case and the pax header file was the first the block and it had this quite weird pax header file path, didn't recheck the details of pax format, thought it is the standard.

Yeah...

@akatsukilelouch akatsukilelouch marked this pull request as draft December 19, 2025 04:00
@akatsukilelouch
Copy link
Author

Maybe it's better to try parse the tar file and, if failed, keep the buffer as is? Or it's better to ditch uncompressed file support completely? Waiting for a decision. I'll implement the tar parsing later, because I need it temporarily. Please close as not planned if you're ditching tar support in the API. Thank you.

@tonistiigi tonistiigi closed this Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants