mirror of
https://github.com/moby/buildkit.git
synced 2025-07-17 10:40:59 +03:00
exporter: support creating blobs with zstd compression
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
4
cache/blobs_linux.go
vendored
4
cache/blobs_linux.go
vendored
@ -1,3 +1,4 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package cache
|
||||
@ -34,7 +35,6 @@ var emptyDesc = ocispecs.Descriptor{}
|
||||
// be computed (e.g. because the mounts aren't overlayfs), it returns
|
||||
// an error.
|
||||
func (sr *immutableRef) tryComputeOverlayBlob(ctx context.Context, lower, upper []mount.Mount, mediaType string, ref string, compressorFunc compressor) (_ ocispecs.Descriptor, ok bool, err error) {
|
||||
|
||||
// Get upperdir location if mounts are overlayfs that can be processed by this differ.
|
||||
upperdir, err := getOverlayUpperdir(lower, upper)
|
||||
if err != nil {
|
||||
@ -50,6 +50,8 @@ func (sr *immutableRef) tryComputeOverlayBlob(ctx context.Context, lower, upper
|
||||
compressorFunc = func(dest io.Writer, requiredMediaType string) (io.WriteCloser, error) {
|
||||
return ctdcompression.CompressStream(dest, ctdcompression.Gzip)
|
||||
}
|
||||
case ocispecs.MediaTypeImageLayer + "+zstd":
|
||||
compressorFunc = zstdWriter
|
||||
default:
|
||||
return emptyDesc, false, errors.Errorf("unsupported diff media type: %v", mediaType)
|
||||
}
|
||||
|
Reference in New Issue
Block a user