containerd/cmd/ctr/commands
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
..
containers Add ctr c info --spec flag to output spec 2020-03-05 12:10:14 -05:00
content ctr/commands/contents: expose ShowProgress 2020-12-11 19:53:44 +09:00
events ctr events: do not exit on an error 2020-01-29 13:10:16 +09:00
images add Image content converter 2021-01-22 13:33:19 +09:00
install Add optional install path 2018-09-11 10:36:00 -04:00
leases *: replace 3600 seconds with 1 hour 2018-08-02 11:40:03 -07:00
namespaces runtime/opts: move WithNamespaceCgroupDeletion from containerd to its own package 2019-08-27 19:02:55 +00:00
oci Add ctr subcommand to print default OCI spec 2020-05-28 14:06:44 -07:00
plugins create local version of introspection service 2020-01-02 12:34:23 -08:00
pprof enhance: support specific duration for profile collection 2018-10-10 22:57:54 +08:00
run Merge pull request #4709 from AkihiroSuda/ctr-apparmor 2020-11-10 10:21:51 -05:00
shim Use path based unix socket for shims 2020-11-11 11:47:46 -08:00
snapshots Add a new flag to images pull for printing out the pulled image's chainID 2021-01-12 15:42:40 -08:00
tasks Merge pull request #4529 from gongguan/creator 2020-09-21 13:33:51 -04:00
version adding go version to client description 2019-10-06 13:38:51 +02:00
client.go implement ctr -connect-timeout 2019-09-16 13:56:53 +02:00
commands_unix.go Add --cpu-quota, --cpu-period flag to ctr 2020-08-06 10:04:59 +09:00
commands_windows.go Adding ctr memory and cpu flags 2018-12-10 13:31:59 -08:00
commands.go Merge pull request #4709 from AkihiroSuda/ctr-apparmor 2020-11-10 10:21:51 -05:00
resolver.go Add ctr flags for configuring default TLS credentials. 2020-05-27 21:59:33 +09:00
signals_linux.go Ignore SIGURG signals in signal forwarder 2020-09-04 16:19:31 -07:00
signals_notlinux.go Ignore SIGURG signals in signal forwarder 2020-09-04 16:19:31 -07:00
signals.go Ignore SIGURG signals in signal forwarder 2020-09-04 16:19:31 -07:00
utils.go Implemented image encryption/decryption libraries and ctr commands 2019-07-17 15:19:58 -04:00