Commit Graph

22 Commits

Author SHA1 Message Date
haoyun
bbe46b8c43 feat: replace github.com/pkg/errors to errors
Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
2022-01-07 10:27:03 +08:00
Mike Brown
391b123a5e adds quiet option for ref
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-20 09:20:14 -05:00
Mike Brown
00f8d32ef5 add not found debug out for check cmd; update usage
Signed-off-by: Mike Brown <brownwm@us.ibm.com>
2021-04-19 19:36:10 -05:00
Maksym Pavlenko
22ef69d77d Support HTTP debug in ctr
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-03-22 09:32:34 -07:00
Phil Estes
51992133af
Allow HTTP tracing in push/pull via --trace flag
Signed-off-by: Phil Estes <estesp@amazon.com>
2021-03-02 20:33:35 -05:00
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
Brian Goff
98b30f4690 Add commands to mount/unmount image from ref
Example:

```terminal
$ mkdir /opt/busybox
$ ctr image mount docker.io/library/busybox:latest /opt/busybox
/opt/busybox
$ ls -lh /opt/busybox
total 40K
drwxr-xr-x 2 root   root     12K Apr 14 01:10 bin
drwxr-xr-x 2 root   root    4.0K Apr 14 01:10 dev
drwxr-xr-x 3 root   root    4.0K Apr 14 01:10 etc
drwxr-xr-x 2 nobody nogroup 4.0K Apr 14 01:10 home
drwx------ 2 root   root    4.0K Apr 14 01:10 root
drwxrwxrwt 2 root   root    4.0K Apr 14 01:10 tmp
drwxr-xr-x 3 root   root    4.0K Apr 14 01:10 usr
drwxr-xr-x 4 root   root    4.0K Apr 14 01:10 var
$ ctr image unmount /opt/busybox
$ ls -lh /opt/busybox
total 0
```

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-04-25 21:00:21 -07:00
Michael Crosby
d085d9b464 Remove encryption code from containerd core
We are separating out the encryption code and have designed a few new
interfaces and APIs for processing content streams.  This keep the core
clean of encryption code but enables not only encryption but support of
multiple content types ( custom media types ).

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-09 15:01:16 +00:00
Stefan Berger
bf8804c743 Implemented image encryption/decryption libraries and ctr commands
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-17 15:19:58 -04:00
Eli Uriegas
af93e4009b ctr: Add images tag subcommand
Adds a subcommand for tagging images managed by containerd.

Usage:

  ctr images tag docker.io/library/alpine:latest docker.io/library/alpine:new

Comes with a --force flag to allow you to gracefully overwrite image references
that already exist.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2019-07-06 15:44:17 +00:00
Ace-Tang
14a050688d ctr: fix image cmd ArgsUsage
ctr image list/check 's ArgsUsage should be filter, not ref

Signed-off-by: Ace-Tang <aceapril@126.com>
2019-03-18 21:11:34 +08:00
Michael Crosby
ae4b78d1cc Move progress into pkg
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-05-22 13:32:25 -04:00
Stephen J Day
ae11d8c64b
cmd/ctr/images: add i alias for images command
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2018-03-12 17:42:41 -07:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Jess Valarezo
61c8fe2307 ctr: snapshot->snapshots cmd, add aliases
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-11-29 14:34:02 -08:00
Derek McGowan
3f1a61f76a
Add synchronous image delete
Synchronous image delete provides an option image delete to wait
until the next garbage collection deletes after an image is removed
before returning success to the caller.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-11-20 17:08:35 -08:00
Phil Estes
08760757ed
Fix output on ctr images rm to show actual feedback
Currently the output for a non-existent image reference and a valid
image reference is exactly the same on `ctr images remove`. Instead of
outputting the target ref input, if it is "not found" we should alert
the user in case of a mispelling, but continue not to make it a failure
for the command (given it supports multiple ref entries)

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2017-11-10 15:21:27 -05:00
Victor Vieux
f8a536ed6a Add S to PLATFORM in images & plugins list
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2017-11-08 10:43:12 -08:00
Phil Estes
ff904841f9
Merge pull request #1668 from jessvalarezo/image-unpack-check
client: Add helper function which checks if an image is unpacked
2017-10-31 10:23:08 -04:00
Jess Valarezo
1552ee23da client: Add helper function which checks if an image is unpacked
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-10-30 16:33:54 -07:00
Jess Valarezo
456d3f4475 ctr: move push and pull to images command
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-10-30 13:23:36 -07:00
Jess Valarezo
f980cc197e ctr: move images command
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-10-25 21:08:00 -04:00