← 返回命令列表

Linux command

ctr 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List

ctr containers list

List

ctr images list

Pull

ctr images pull [image]

Tag

ctr images tag [source_image]:[source_tag] [target_image]:[target_tag]

List images

ctr -n k8s.io images list

Run

ctr run [docker.io/library/alpine:latest] [my-container]

说明

ctr is the command-line client for containerd, the industry-standard container runtime. It provides low-level container and image management capabilities. Unlike Docker CLI, ctr is designed for debugging and direct containerd interaction rather than general use. Kubernetes typically uses containerd through crictl instead.

参数

-n, --namespace _namespace_
Namespace to use. Default: default. Kubernetes uses k8s.io.
--address _address_
Address for containerd's GRPC server.
--connect-timeout _duration_
Timeout for connecting to containerd.
--debug
Enable debug output in logs.

FAQ

What is the ctr command used for?

ctr is the command-line client for containerd, the industry-standard container runtime. It provides low-level container and image management capabilities. Unlike Docker CLI, ctr is designed for debugging and direct containerd interaction rather than general use. Kubernetes typically uses containerd through crictl instead.

How do I run a basic ctr example?

Run `ctr containers list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -n, --namespace _namespace_ do in ctr?

Namespace to use. Default: default. Kubernetes uses k8s.io.