Skip to content

Instantly share code, notes, and snippets.

@afbjorklund
Last active April 21, 2020 17:16
Show Gist options
  • Save afbjorklund/86d0454d1d5ea6ffdafd1fc552798414 to your computer and use it in GitHub Desktop.
Save afbjorklund/86d0454d1d5ea6ffdafd1fc552798414 to your computer and use it in GitHub Desktop.
Handling containerd snapshots with ctr
root@minikube:/var/lib/containerd# ctr i pull docker.io/library/busybox:latest
docker.io/library/busybox:latest:                                                 resolved       |++++++++++++++++++++++++++++++++++++++| 
index-sha256:a8cf7ff6367c2afa2a90acd081b484cbded349a7076e7bdf37a05279f276bc12:    done           |++++++++++++++++++++++++++++++++++++++| 
manifest-sha256:a2490cec4484ee6c1068ba3a05f89934010c85242f736280b35343483b2264b6: done           |++++++++++++++++++++++++++++++++++++++| 
layer-sha256:e2334dd9fee4b77e48a8f2d793904118a3acf26f1f2e72a3d79c6cae993e07f0:    done           |++++++++++++++++++++++++++++++++++++++| 
config-sha256:be5888e67be651f1fbb59006f0fd791b44ed3fceaa6323ab4e37d5928874345a:   done           |++++++++++++++++++++++++++++++++++++++| 
elapsed: 2.6 s                                                                    total:  569.0  (218.8 KiB/s)                                     
unpacking linux/amd64 sha256:a8cf7ff6367c2afa2a90acd081b484cbded349a7076e7bdf37a05279f276bc12...
done
root@minikube:/var/lib/containerd# ctr snapshot ls
KEY                                                                     PARENT KIND      
sha256:5b0d2d635df829f65d0ffb45eab2c3124a470c4f385d6602bda0c21c5248bcab        Committed 
root@minikube:/var/lib/containerd# ctr i check
REF                              TYPE                                                      DIGEST                                                                  STATUS         SIZE                UNPACKED 
docker.io/library/busybox:latest application/vnd.docker.distribution.manifest.list.v2+json sha256:a8cf7ff6367c2afa2a90acd081b484cbded349a7076e7bdf37a05279f276bc12 complete (2/2) 744.5 KiB/744.5 KiB true
root@minikube:/var/lib/containerd# ctr snapshot rm sha256:5b0d2d635df829f65d0ffb45eab2c3124a470c4f385d6602bda0c21c5248bcab
root@minikube:/var/lib/containerd# ctr i check
REF                              TYPE                                                      DIGEST                                                                  STATUS         SIZE                UNPACKED 
docker.io/library/busybox:latest application/vnd.docker.distribution.manifest.list.v2+json sha256:a8cf7ff6367c2afa2a90acd081b484cbded349a7076e7bdf37a05279f276bc12 complete (2/2) 744.5 KiB/744.5 KiB false
root@minikube:/var/lib/containerd# ctr snapshot unpack sha256:a8cf7ff6367c2afa2a90acd081b484cbded349a7076e7bdf37a05279f276bc12
unpacking sha256:a8cf7ff6367c2afa2a90acd081b484cbded349a7076e7bdf37a05279f276bc12 (application/vnd.docker.distribution.manifest.list.v2+json)...done
root@minikube:/var/lib/containerd# ctr i check
REF                              TYPE                                                      DIGEST                                                                  STATUS         SIZE                UNPACKED 
docker.io/library/busybox:latest application/vnd.docker.distribution.manifest.list.v2+json sha256:a8cf7ff6367c2afa2a90acd081b484cbded349a7076e7bdf37a05279f276bc12 complete (2/2) 744.5 KiB/744.5 KiB true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment