You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sudo apt-get install containerd -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
containerd is already the newest version (1.7.2-0ubuntu1~22.04.1).
containerd set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
This section is extensive and contains configurations for various ContainerD plugins. Only key plugins and configurations are listed here.
io.containerd.gc.v1.scheduler
Garbage collection settings.
io.containerd.grpc.v1.cri
Settings for Container Runtime Interface (CRI), crucial for Kubernetes.
Runtimes (runc, etc.)
Define and configure container runtimes.
Proxy Plugins
Key
Description
plugin_name
Configuration for specific proxy plugin.
Stream Processors
Key
Description
processor_name
Configuration for specific stream processor.
Timeouts
Key
Description
timeout_name
Various timeout settings for ContainerD operations.
TTRPC
Key
Description
address
Address for TTRPC communication.
uid, gid
User/Group ID for TTRPC socket.
Verify ContainerD CLI - Ctr available on your system
sangam@sangam:~$ ctr
NAME:
ctr -
__
_____/ /______
/ ___/ __/ ___/
/ /__/ /_/ /
\___/\__/_/
containerd CLI
USAGE:
ctr [global options] command [command options] [arguments...]
VERSION:
1.7.2
DESCRIPTION:
ctr is an unsupported debug and administrative client for interacting
with the containerd daemon. Because it is unsupported, the commands,
options, and operations are not guaranteed to be backward compatible or
stable from release to release of the containerd project.
COMMANDS:
plugins, plugin Provides information about containerd plugins
version Print the client and server versions
containers, c, container Manage containers
content Manage content
events, event Display containerd events
images, image, i Manage images
leases Manage leases
namespaces, namespace, ns Manage namespaces
pprof Provide golang pprof outputs for containerd
run Run a container
snapshots, snapshot Manage snapshots
tasks, t, task Manage tasks
install Install a new package
oci OCI tools
sandboxes, sandbox, sb, s Manage sandboxes
info Print the server info
shim Interact with a shim directly
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--debug Enable debug output in logs
--address value, -a value Address for containerd's GRPC server (default: "/run/containerd/containerd.sock") [$CONTAINERD_ADDRESS]
--timeout value Total timeout for ctr commands (default: 0s)
--connect-timeout value Timeout for connecting to containerd (default: 0s)
--namespace value, -n value Namespace to use with commands (default: "default") [$CONTAINERD_NAMESPACE]
--help, -h show help
--version, -v print the version
sangam@sangam:~$
ctr Command Examples for ContainerD
ctr is a command-line utility provided by ContainerD for interacting with the ContainerD daemon. It's used for development, debugging, and low-level container operations. Below are some common examples of how to use ctr commands.
sangam@sangam:~$ sudo ctr run --rm -t docker.io/library/hello-world
ctr: container id must be provided
docker.io/library/hello-world:latest: resolved |++++++++++++++++++++++++++++++++++++++|
index-sha256:4bd78111b6914a99dbc560e6a20eab57ff6655aea4a80c50b0c5491968cbc2e6: done |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:2d4e459f4ecb5329407ae3e47cbc107a2fbace221354ca75960af4c047b3cb13: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:478afc9190022e867bb857b1a25cc5abc7678287af6cb930562ec25be709f1b7: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:ee301c921b8aadc002973b2e0c3da17d701dcd994b606769a7e6eaa100b81d44: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 6.5 s total: 10.3 K (1.6 KiB/s)
unpacking linux/arm64/v8 sha256:4bd78111b6914a99dbc560e6a20eab57ff6655aea4a80c50b0c5491968cbc2e6...
done: 15.890923ms
Run a Container
sangam@sangam:~$ sudo ctr run --rm -t docker.io/library/hello-world:latest hello-world
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(arm64v8)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
sangam@sangam:~$
List Images
sudo ctr images list
REF TYPE DIGEST SIZE PLATFORMS LABELS
docker.io/library/hello-world:latest application/vnd.oci.image.index.v1+json sha256:4bd78111b6914a99dbc560e6a20eab57ff6655aea4a80c50b0c5491968cbc2e6 13.4 KiB linux/386,linux/amd64,linux/arm/v5,linux/arm/v7,linux/arm64/v8,linux/mips64le,linux/ppc64le,linux/riscv64,linux/s390x,unknown/unknown,windows/amd64 -
ctr tasks exec
NAME:
ctr tasks exec - Execute additional processes in an existing container
USAGE:
ctr tasks exec [command options] [flags] CONTAINER CMD [ARG...]
OPTIONS:
--cwd value Working directory of the new process
--tty, -t Allocate a TTY for the container
--detach, -d Detach from the task after it has started execution
--exec-id value Exec specific id for the process
--fifo-dir value Directory used for storing IO FIFOs
--log-uri value Log uri for custom shim logging
--user value User id or name
ctr: Required flag "exec-id" not set
sangam@sangam:~$ sudo ctr images pull docker.io/library/busybox:latest
docker.io/library/busybox:latest: resolving |--------------------------------------|
docker.io/library/busybox:latest: resolved |++++++++++++++++++++++++++++++++++++++|
index-sha256:6d9ac9237a84afe1516540f40a0fafdc86859b2141954b4d643af7066d598b74: done |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:8f03917912ea995c637b6c0295846aaff5665f06ac82a29b421fba4c379494e7: done |++++++++++++++++++++++++++++++++++++++|
layer-sha256:c2bf9493c1bf786e95e3eac7d406c20aa1b8a2d40916756e891627e9e8f8d119: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:3e4fd538a9a0b729be05707cf805388be2fb701cfd5d44c6542f1988e8aef6e3: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 2.3 s total: 0.0 B (0.0 B/s)
unpacking linux/arm64/v8 sha256:6d9ac9237a84afe1516540f40a0fafdc86859b2141954b4d643af7066d598b74...
done: 4.323205ms
Mem: 2554748K used, 1450628K free, 1432K shrd, 84568K buff, 1617808K cached
CPU: 4.3% usr 0.8% sys 0.0% nic 94.5% idle 0.1% io 0.0% irq 0.2% sirq
Load average: 0.29 0.23 0.20 1/361 12
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
1 0 root R 3984 0.1 0 0.0 top
open new terminal
sangam@sangam:~$ sudo ctr tasks exec --exec-id exec1 busybox-container ls /
bin
dev
etc
home
lib
lib64
proc
root
run
sys
tmp
usr
var
View Container Logs
sangam@sangam:~$ sudo ctr tasks ls
TASK PID STATUS
busybox-container 98767 RUNNING
sangam@sangam:~$ sudo ctr container ls
CONTAINER IMAGE RUNTIME
busybox-container docker.io/library/busybox:latest io.containerd.runc.v2
journalctl -u containerd
Stop a Container
sudo ctr tasks kill busybox-container
Delete a Container
sangam@sangam:~$ sudo ctr containers -h
NAME:
ctr containers - Manage containers
USAGE:
ctr containers command [command options] [arguments...]
COMMANDS:
create Create container
delete, del, remove, rm Delete one or more existing containers
info Get info about a container
list, ls List containers
label Set and clear labels for a container
checkpoint Checkpoint a container
restore Restore a container from checkpoint
OPTIONS:
--help, -h show help
sangam@sangam:~$ sudo ctr containers del busybox-container
Ctr plugins
sangam@sangam:~$ sudo ctr plugins list
TYPE ID PLATFORMS STATUS
io.containerd.snapshotter.v1 aufs linux/arm64/v8 skip
io.containerd.snapshotter.v1 btrfs linux/arm64/v8 skip
io.containerd.content.v1 content - ok
io.containerd.snapshotter.v1 native linux/arm64/v8 ok
io.containerd.snapshotter.v1 overlayfs linux/arm64/v8 ok
io.containerd.snapshotter.v1 devmapper linux/arm64/v8 error
io.containerd.snapshotter.v1 zfs linux/arm64/v8 skip
io.containerd.metadata.v1 bolt - ok
io.containerd.differ.v1 walking linux/arm64/v8 ok
io.containerd.event.v1 exchange - ok
io.containerd.gc.v1 scheduler - ok
io.containerd.lease.v1 manager - ok
io.containerd.nri.v1 nri - ok
io.containerd.runtime.v2 task linux/arm64/v8 ok
io.containerd.runtime.v2 shim - ok
io.containerd.sandbox.store.v1 local - ok
io.containerd.sandbox.controller.v1 local - ok
io.containerd.streaming.v1 manager - ok
io.containerd.service.v1 introspection-service - ok
io.containerd.service.v1 containers-service - ok
io.containerd.service.v1 content-service - ok
io.containerd.service.v1 diff-service - ok
io.containerd.service.v1 images-service - ok
io.containerd.service.v1 namespaces-service - ok
io.containerd.service.v1 snapshots-service - ok
io.containerd.runtime.v1 linux linux/arm64/v8 ok
io.containerd.monitor.v1 cgroups linux/arm64/v8 ok
io.containerd.service.v1 tasks-service - ok
io.containerd.grpc.v1 introspection - ok
io.containerd.transfer.v1 local - ok
io.containerd.internal.v1 restart - ok
io.containerd.grpc.v1 containers - ok
io.containerd.grpc.v1 content - ok
io.containerd.grpc.v1 diff - ok
io.containerd.grpc.v1 events - ok
io.containerd.grpc.v1 healthcheck - ok
io.containerd.grpc.v1 images - ok
io.containerd.grpc.v1 leases - ok
io.containerd.grpc.v1 namespaces - ok
io.containerd.internal.v1 opt - ok
io.containerd.grpc.v1 sandbox-controllers - ok
io.containerd.grpc.v1 sandboxes - ok
io.containerd.grpc.v1 snapshots - ok
io.containerd.grpc.v1 streaming - ok
io.containerd.grpc.v1 tasks - ok
io.containerd.grpc.v1 transfer - ok
io.containerd.grpc.v1 version - ok
io.containerd.grpc.v1 cri linux/arm64/v8 ok
io.containerd.tracing.processor.v1 otlp - skip
io.containerd.internal.v1 tracing - ok
which appears to be a manifest list or an image index in the OCI (Open Container Initiative) format. It's a JSON file that describes an image in a container registry, such as Docker Hub