containerd/cmd/ctr/commands/images
Akihiro Suda 5ca3ac65c4
add Image content converter
Go example:
```go
opts := []converter.Opt{
  // convert Docker media types to OCI ones
  converter.WithDocker2OCI(true),
  // convert tar.gz layers to uncompressed tar layers
  converter.WithLayerConvertFunc(uncompress.LayerConvertFunc),
}
srcRef := "example.com/foo:orig"
dstRef := "example.com/foo:converted"
dstImg, err = converter.Convert(ctx, client, dstRef, srcRef, opts...)
fmt.Println(dstImg.Target)
```

ctr example: `ctr images convert --oci --uncompress example.com/foo:orig example.com/foo:converted`

Go test: `go test -exec sudo -test.root -test.run TestConvert`

The implementation is from https://github.com/containerd/stargz-snapshotter/pull/224,
but eStargz-specific functions are not included in this PR.

eStargz converter can be specified by importing `estargz` package and using `WithLayerConvertFunc(estargz.LayerConvertFunc)` option.

This converter interface will be potentially useful for converting zstd and ocicrypt layers as well.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-01-22 13:33:19 +09:00
..
convert.go add Image content converter 2021-01-22 13:33:19 +09:00
export.go export: add --skip-non-distributable 2021-01-01 06:32:01 +09:00
images.go add Image content converter 2021-01-22 13:33:19 +09:00
import.go Add option to compress blobs on import 2019-07-25 12:05:38 -07:00
mount.go WithLease: always return context and done fn 2020-04-25 21:16:43 -07:00
pull.go Add a new flag to images pull for printing out the pulled image's chainID 2021-01-12 15:42:40 -08:00
push.go Support pushing a specific platform of a multi-architecture docker image to a registry 2019-12-23 17:24:45 +08:00
tag.go ctr: Add images tag subcommand 2019-07-06 15:44:17 +00:00
unmount.go ctr: fix the incorrect image unmount error hint 2020-11-11 19:57:31 +08:00