Connection
ctr --namespace=k8s.io --address=/run/containerd/containerd.sock
Connect to containerd socket with kubernetes namespace
export CONTAINERD_NAMESPACE=k8s.io
Set default namespace for containerd commands
export CONTAINERD_ADDRESS=/run/containerd/containerd.sock
Set default socket address for containerd commands
Container Management
ctr containers list
List all containers
ctr containers create [flags]
Create a new container
ctr containers delete
Delete a container
ctr containers info
Display detailed information about a container
ctr containers label [flags]
Set and clear container labels
Image Management
ctr images list
List all images
ctr images pull
Pull an image from a registry
ctr images push
Push an image to a registry
ctr images remove
Remove an image
ctr images import
Import images from a tar file
ctr images export [, ...]
Export images to a tar file
ctr images mount
Mount an image to a directory
ctr images unmount
Unmount an image
Tasks
ctr tasks list
List all tasks (running containers)
ctr tasks start [flags]
Start a container
ctr tasks pause
Pause a container
ctr tasks resume
Resume a paused container
ctr tasks kill [flags] [signal]
Send a signal to a container
ctr tasks exec --exec-id [args...]
Execute a command in a container
ctr tasks ps
List processes in a container
ctr tasks metrics
Get container metrics
Snapshots
ctr snapshots list
List all snapshots
ctr snapshots prepare []
Prepare a snapshot
ctr snapshots view
View snapshot details
ctr snapshots remove
Remove a snapshot
ctr snapshots usage
Get snapshot disk usage
Namespaces
ctr namespaces list
List all namespaces
ctr namespaces create
Create a new namespace
ctr namespaces remove
Remove a namespace
ctr namespaces label =
Set a label on a namespace
Content
ctr content ls
List all content
ctr content get
Get content by digest
ctr content delete
Delete content by digest
ctr content ingest
Ingest file content into containerd
Plugins
ctr plugins ls
List all plugins