Merge pull request #3455 from dmcgowan/fix-default-import-compression

Add option to compress blobs on import
This commit is contained in:
Phil Estes
2019-07-25 16:45:11 -04:00
committed by GitHub
3 changed files with 66 additions and 14 deletions

View File

@@ -72,6 +72,10 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb
Name: "no-unpack",
Usage: "skip unpacking the images, false by default",
},
cli.BoolFlag{
Name: "compress-blobs",
Usage: "compress uncompressed blobs when creating manifest (Docker format only)",
},
}, commands.SnapshotterFlags...),
Action: func(context *cli.Context) error {
@@ -97,6 +101,10 @@ If foobar.tar contains an OCI ref named "latest" and anonymous ref "sha256:deadb
opts = append(opts, containerd.WithIndexName(idxName))
}
if context.Bool("compress-blobs") {
opts = append(opts, containerd.WithImportCompression())
}
opts = append(opts, containerd.WithAllPlatforms(context.Bool("all-platforms")))
client, ctx, cancel, err := commands.NewClient(context)