build: add support for zstd image compression - #2376
Open
milas wants to merge 1 commit into
Open
Conversation
Author
|
FYI I did a quick scan of other open issues/PRs -- I do see there's WIP for adding EROFS (very cool!) @ #2249, which I don't think really conflicts. Arguably, this can work together with that since EROFS layers can similarly be gzip/zstd/etc compressed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
A pretty mechanical plumbing of a new
--compressionflag through the various machinery.The default is still
gzipfor backwards compatibility, but--compression=zstdcan be specified as an alternative.Container runtimes have good zstd support these days and it compresses better/with less CPU than gzip.
Context
Starting with
google/go-containerregistryv0.21.8, it's possible to make images with correctly named ZSTD-compressed layers.(Previously, it was possible to write zstd-compressed layer data, but it'd still be
.tar.gz, which was confusing at best but more likely to break downstream tooling.)See google/go-containerregistry#2382
The
go.modhere already picked that up, so no dependency update is necessary.