export: add --skip-non-distributable

The flag skips adding non-distributable blobs such as Windows layers to archive.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2021-01-01 06:29:00 +09:00
parent 9067796ce4
commit e2e2c5737d
3 changed files with 54 additions and 7 deletions

View File

@@ -44,6 +44,10 @@ When '--all-platforms' is given all images in a manifest list must be available.
Name: "skip-manifest-json",
Usage: "do not add Docker compatible manifest.json to archive",
},
cli.BoolFlag{
Name: "skip-non-distributable",
Usage: "do not add non-distributable blobs such as Windows layers to archive",
},
cli.StringSliceFlag{
Name: "platform",
Usage: "Pull content from a specific platform",
@@ -86,6 +90,10 @@ When '--all-platforms' is given all images in a manifest list must be available.
exportOpts = append(exportOpts, archive.WithSkipDockerManifest())
}
if context.Bool("skip-non-distributable") {
exportOpts = append(exportOpts, archive.WithSkipNonDistributableBlobs())
}
client, ctx, cancel, err := commands.NewClient(context)
if err != nil {
return err