Skip to content

compression: expose shared archive detection - #7148

Open
crazy-max wants to merge 1 commit into
moby:masterfrom
crazy-max:refactor-shared-archive-detection
Open

crazy-max wants to merge 1 commit into
moby:masterfrom
crazy-max:refactor-shared-archive-detection

Conversation

@crazy-max

Copy link
Copy Markdown
Member

relates to docker/buildx#4079

This extracts the archive detection helper from #7034 as compression.IsArchive so BuildKit and Buildx can share the same format detection, including zstd skippable frames. The Dockerfile frontend now uses this helper, and layer compression detection reuses its gzip and zstd prefix checks. This keeps the shared detection independent of the decompression and archive extraction changes in #7034.

Related to docker/buildx#4079, which fixes zstd-compressed contexts being interpreted as Dockerfiles on stdin. Buildx performs that classification before uploading the context, so BuildKit frontend support alone cannot fix it. Once Buildx vendors BuildKit containing this change, the follow-up is to replace its local build.isArchive implementation with compression.IsArchive . This addresses the detection gap without maintaining a second magic-byte table.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
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.

1 participant