client: add Import() and Export() for importing/exporting image in OCI format

Export as a tar (Note: "-" can be used for stdout):

    $ ctr images export /tmp/oci-busybox.tar docker.io/library/busybox:latest

Import a tar (Note: "-" can be used for stdin):

    $ ctr images import foo/new:latest /tmp/oci-busybox.tar

Note: media types are not converted at the moment: e.g.
  application/vnd.docker.image.rootfs.diff.tar.gzip
  -> application/vnd.oci.image.layer.v1.tar+gzip

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2017-06-15 08:50:20 +00:00
parent 856b038437
commit b518f11dba
13 changed files with 904 additions and 284 deletions

View File

@@ -22,6 +22,8 @@ var imageCommand = cli.Command{
imagesListCommand,
imageRemoveCommand,
imagesSetLabelsCommand,
imagesImportCommand,
imagesExportCommand,
},
}