Closed arnarg closed 5 years ago
I like option 2.
I added the Size field. It depends on github.com/containerd/containerd/pkg/progress
to convert the size from int64
to string
but it's missing, is it ok to add?
I also tried with the Digest field and it looked weird, maybe it can be formatted better or skipped altogether?
REPOSITORY TAG DIGEST CREATED SIZE
godarch/arch latest sha256:b15f7a112a30b04dc32ecaa56e00f0a5ac3b7a38978d80fe4b80ff97353bce5d 2019-02-14 153.1 MiB
godarch/ubuntu latest sha256:f5e7dd5e396a8a921a6452697deb3f0f4f572f63079da56a5383620d0dea7b24 2019-02-16 359.6 MiB
Run the following to fix the build error:
make ci_deps
make vendor
I did that but github.com/containerd/containerd/pkg/progress
has a dependency on github.com/docker/go-units
and make vendor
doesn't seem to be pulling that in.
Ah, then you'll want to add "github.com/docker/go-units" to the vendor.conf, and make sure it uses the same exact version the containerd is referencing.
github.com/docker/go-units v0.3.1
fixes #10
This produces the following output:
If we want to also print the image id (digest) and size we would need to one of the following (that I can think of).
Image
struct. Then insession.GetImages()
we would need to callcontainerd.Image.Size()
to calculate the size of each image. This would be unnecessarily expensive if you're not printing the table.session.client.ImageService().Get()
to get the originalcontainerd.Image
object for each image and then calculate the size.containerd.Image
in theImage
struct.What do you think?