ctr(8)
π ctr β System Manager's Manual, section 8 β¨
okay bestie, buckle UP, because this one is a whole journey π
πΈ NAME πΈ
ctr β the containerd debug and admin client, no cap π
π SYNOPSIS π
ctr
[--address|-a]=[value]
[--connect-timeout]=[value]
[--debug]
[--namespace|-n]=[value]
[--timeout]=[value]
π¦ DESCRIPTION π¦
So here's the tea: ctr is an unsupported debug and administrative client for talking to the containerd daemon. Literally that's its whole thing. π«Ά
And because it's unsupported, bestie, listen carefully: the commands, the options, and the operations are not guaranteed to be backward compatible or stable from release to release of the containerd project. it's giving "vibes only, no promises" π so don't build your whole production pipeline on it and then act surprised, iykyk.
Usage, bestie:
ctr [GLOBAL OPTIONS] [command [COMMAND OPTIONS]] [ARGUMENTS...]
β¨ GLOBAL OPTIONS β¨
these apply to like, everything. the main character settings π
--address,-a="<value>" β the address of containerd's GRPC server. default:"/run/containerd/containerd.sock"π--connect-timeout="<value>" β how long to wait while connecting to containerd. default:0sβ³--debugβ turn on debug output in the logs. yes queen, show us everything π₯--namespace,-n="<value>" β which namespace to use with commands. default:"default"π--timeout="<value>" β the total timeout forctrcommands. default:0sπ
π COMMANDS π
so many commands. so little time. let's go β
π§ plugins, plugin
gives you info about containerd plugins. it's giving backstage tour π«Ά
list, ls
lists containerd plugins β¨
--detailed,-dβ print detailed info about each plugin (the full gossip π )--quiet,-qβ print only the plugin ids (minimalist queen)
inspect-runtime
displays runtime info π
--runc-binary="<value>" β specify a runc-compatible binary--runc-root="<value>" β specify a runc-compatible root--runc-systemd-cgroupβ start runc with the systemd cgroup manager--runtime="<value>" β runtime name or absolute path to the runtime binary. default:"io.containerd.runc.v2"--runtime-config-path="<value>" β optional runtime config path
π version
prints the client AND the server versions. both of them. it's a duo π
π containers, c, container
manage containers. the whole point, bestie π
create
creates a container β¨
--allow-new-privsβ turn off the OCI spec'sNoNewPrivilegesfeature flag--annotation="<value>" β specify additional OCI annotations (e.g.foo=bar)--apparmor-default-profile="<value>" β enable AppArmor with the default profile with the specified name, e.g."cri-containerd.apparmor.d"--apparmor-profile="<value>" β enable AppArmor with an existing custom profile--blockio-class="<value>" β name of the blockio class to associate the container with--blockio-config-file="<value>" β file path to blockio class definitions. by default class definitions are not loaded.--cap-add="<value>" β add Linux capabilities (set capabilities with the'CAP_'prefix)--cap-drop="<value>" β drop Linux capabilities (set capabilities with the'CAP_'prefix)--config,-c="<value>" β path to the runtime-specific spec config file--cpu-period="<value>" β limit CPU CFS period. default:0--cpu-quota="<value>" β limit CPU CFS quota. default:-1--cwd="<value>" β specify the working directory of the process--device="<value>" β file path to a device to add to the container; or a path to a directory tree of devices to add to the container--env="<value>" β specify additional container environment variables (e.g.FOO=bar)--env-file="<value>" β specify additional container environment variables in a file(e.g.FOO=bar, one per line)--gpus="<value>" β add gpus to the container--hostname="<value>" β set the container's host name--label="<value>" β specify additional labels (e.g.foo=bar)--memory-limit="<value>" β memory limit (in bytes) for the container. default:0--mount="<value>" β specify an additional container mount (e.g.type=bind,src=/tmp,dst=/host,options=rbind:ro)--net-hostβ enable host networking for the container--no-pivotβ disable use of pivot-root (linux only)--pid-file="<value>" β file path to write the task's pid--privilegedβ run a privileged container π₯--rdt-class="<value>" β name of the RDT class to associate the container with. specifies a Class of Service (CLOS) for cache and memory bandwidth management.--read-onlyβ set the container's filesystem as read-only--rootfsβ use a custom rootfs that is not managed by the containerd snapshotter--rootfs-propagation="<value>" β set the propagation of the container rootfs--runc-binary="<value>" β specify a runc-compatible binary--runc-root="<value>" β specify a runc-compatible root--runc-systemd-cgroupβ start runc with the systemd cgroup manager--runtime="<value>" β runtime name or absolute path to the runtime binary. default:"io.containerd.runc.v2"--runtime-config-path="<value>" β optional runtime config path--sandbox="<value>" β create the container in the given sandbox--seccompβ enable the default seccomp profile--seccomp-profile="<value>" β file path to a custom seccomp profile. seccomp must be set to true before using seccomp-profile β οΈ--snapshotter="<value>" β snapshotter name. an empty value stands for the default value.--snapshotter-label="<value>" β labels added to the new snapshot for this container.--tty,-tβ allocate a TTY for the container π«Ά--user,-u="<value>" β username or user id, group optional (format:[:])--with-ns="<value>" β specify existing Linux namespaces to join at container runtime (format':')
delete, del, remove, rm
delete one or more existing containers. bye bestie π
--keep-snapshotβ do not clean up the snapshot with the container
info
get info about a container π
--specβ only display the spec
list, ls
list containers β¨
--quiet,-qβ print only the container id
label
set and clear labels for a container π·οΈ
checkpoint
checkpoint a container πΎ
--imageβ include the image in the checkpoint--rwβ include the rw layer in the checkpoint--taskβ checkpoint the container task
restore
restore a container from a checkpoint π¦
--liveβ restore the runtime and memory data from the checkpoint--rwβ restore the rw layer from the checkpoint
π content
manage content. the blob zone π
active
display active transfers π
--root="<value>" β path to the content store root. default:"/tmp/content"--timeout,-t="<value>" β total timeout for fetch. default:0s
delete, del, remove, rm
permanently delete one or more blobs. like, PERMANENTLY. no undo, bestie π
edit
edit a blob and return a new digest βοΈ
--editor="<value>" β select editor (vim,emacs, etc.)--validate="<value>" β validate the result against a format (json,mediatype, etc.)
fetch
fetch all content for an image into containerd π
--all-platformsβ pull content from all platforms--hosts-dir="<value>" β custom hosts configuration directory--http-dumpβ dump all HTTP request/responses when interacting with the container registry--http-traceβ enable HTTP tracing for registry interactions--label="<value>" β labels to attach to the image--metadata-onlyβ pull all metadata including manifests and configs--plain-httpβ allow connections using plain HTTP--platform="<value>" β pull content from a specific platform--refresh="<value>" β refresh token for the authorization server--skip-metadataβ skips metadata for unused platforms (the image may be unable to be pushed without metadata) β οΈ--skip-verify,-kβ skip SSL certificate validation π₯--tlscacert="<value>" β path to the TLS root CA--tlscert="<value>" β path to the TLS client certificate--tlskey="<value>" β path to the TLS client key--user,-u="<value>" β User[:password] registry user and password
fetch-object
retrieve objects from a remote π¦
--hosts-dir="<value>" β custom hosts configuration directory--http-dumpβ dump all HTTP request/responses when interacting with the container registry--http-traceβ enable HTTP tracing for registry interactions--plain-httpβ allow connections using plain HTTP--refresh="<value>" β refresh token for the authorization server--skip-verify,-kβ skip SSL certificate validation π₯--tlscacert="<value>" β path to the TLS root CA--tlscert="<value>" β path to the TLS client certificate--tlskey="<value>" β path to the TLS client key--user,-u="<value>" β User[:password] registry user and password
fetch-blob
retrieve blobs from a remote π«§
--hosts-dir="<value>" β custom hosts configuration directory--http-dumpβ dump all HTTP request/responses when interacting with the container registry--http-traceβ enable HTTP tracing for registry interactions--media-type="<value>" β specify target mediatype for request header--plain-httpβ allow connections using plain HTTP--refresh="<value>" β refresh token for the authorization server--skip-verify,-kβ skip SSL certificate validation π₯--tlscacert="<value>" β path to the TLS root CA--tlscert="<value>" β path to the TLS client certificate--tlskey="<value>" β path to the TLS client key--user,-u="<value>" β User[:password] registry user and password
get
get the data for an object π
ingest
accept content into the store π§Ί
--expected-digest="<value>" β verify content against the expected digest--expected-size="<value>" β validate against the provided size. default:0
list, ls
list all blobs in the store β¨
--quiet,-qβ print only the blob digest
push-object
push an object to a remote π
--hosts-dir="<value>" β custom hosts configuration directory--http-dumpβ dump all HTTP request/responses when interacting with the container registry--http-traceβ enable HTTP tracing for registry interactions--plain-httpβ allow connections using plain HTTP--refresh="<value>" β refresh token for the authorization server--skip-verify,-kβ skip SSL certificate validation π₯--tlscacert="<value>" β path to the TLS root CA--tlscert="<value>" β path to the TLS client certificate--tlskey="<value>" β path to the TLS client key--user,-u="<value>" β User[:password] registry user and password
label
add labels to content π·οΈ
prune
prunes content from the content store βοΈ
references
prunes preference labels from the content store (layers only by default) π
--asyncβ allow garbage collection to clean up asynchronously--dryβ just show updates without applying them (this enables debug logging)
π events, event
display containerd events π‘
π images, image, i
Bestie. This is the one you'll actually use every single day. Manage images π You can say images, image, or just i, they're all the same vibe.
π§ check
Check existing images to make sure all their content is sitting there locally (no missing blobs, no half-downloaded heartbreak).
--quiet,-qβ Print only the ready image refs (the ones that are fully downloaded and unpacked). So clean, so minimal. β¨--snapshotter=""β Snapshotter name. An empty value stands for the default value.
π¦ export
Export images. Yes, take them out. π«Ά
--all-platformsβ Exports content from all platforms--localβ Run export locally rather than through transfer API--platform=""β Pull content from a specific platform--skip-manifest-jsonβ Do not add Docker compatiblemanifest.jsonto archive--skip-non-distributableβ Do not add non-distributable blobs such as Windows layers to archive
π₯ import
Import images, bestie. Bring them in.
--all-platformsβ Imports content for all platforms,falseby default--base-name=""β Base image name for added images, when provided only images with this name prefix are imported--compress-blobsβ Compress uncompressed blobs when creating manifest (Docker format only)--digestsβ Whether to create digest images (default:false)--discard-unpacked-layersβ Allow the garbage collector to clean layers up from the content store after unpacking, cannot be used with--no-unpack,falseby default--index-name=""β Image name to keep index as, by default index is discarded--label=""β Labels to attach to the image--localβ Run import locally rather than through transfer API--no-unpackβ Skip unpacking the images, cannot be used with--discard-unpacked-layers,falseby default--platform=""β Imports content for specific platform--skip-digest-for-namedβ Skip applying--digestsoption to images named in the importing tar (use it in conjunction with--digests)--snapshotter=""β Snapshotter name. Empty value stands for the default value.--sync-fsβ Synchronize the underlying filesystem containing files when unpack images,falseby default
π inspect, i
inspect an image. Little peek under the hood, no cap. π
--contentβ Show JSON content
π list, ls
List images known to containerd
--quiet,-qβ Print only the image refs
ποΈ mount
Mount an image to a target path
--expiration,-x=""β Set the expiration time for the mount and snapshots (default:1h0m0s)--hosts-dir=""β Custom hosts configuration directory--http-dumpβ Dump all HTTP request/responses when interacting with container registry--http-traceβ Enable HTTP tracing for registry interactions--label=""β Labels to attach to the image--plain-httpβ Allow connections using plain HTTP--platform=""β Mount the image for the specified platform (default:"linux/amd64")--refresh=""β Refresh token for authorization server--rwβ Enable write support on the mount--skip-verify,-kβ Skip SSL certificate validation--snapshotter=""β Snapshotter name. Empty value stands for the default value.--sync-fsβ Synchronize the underlying filesystem containing files when unpack images,falseby default--tlscacert=""β Path to TLS root CA--tlscert=""β Path to TLS client certificate--tlskey=""β Path to TLS client key--user,-u=""βUser[:password]Registry user and password
πͺ unmount
Unmount the image from the target
--hosts-dir=""β Custom hosts configuration directory--http-dumpβ Dump all HTTP request/responses when interacting with container registry--http-traceβ Enable HTTP tracing for registry interactions--label=""β Labels to attach to the image--plain-httpβ Allow connections using plain HTTP--refresh=""β Refresh token for authorization server--rmβ Remove the snapshot after a successful unmount--skip-verify,-kβ Skip SSL certificate validation--snapshotter=""β Snapshotter name. Empty value stands for the default value.--tlscacert=""β Path to TLS root CA--tlscert=""β Path to TLS client certificate--tlskey=""β Path to TLS client key--user,-u=""βUser[:password]Registry user and password
π§² pull
Pull an image from a remote. The classic. The moment. π₯
--all-platformsβ Pull content and metadata from all platforms--hosts-dir=""β Custom hosts configuration directory--http-dumpβ Dump all HTTP request/responses when interacting with container registry--http-traceβ Enable HTTP tracing for registry interactions--label=""β Labels to attach to the image--localβ Fetch content from local client rather than using transfer service--max-concurrent-downloads=""β Set the max concurrent downloads for each pull (default:0)--plain-httpβ Allow connections using plain HTTP--platform=""β Pull content from a specific platform--print-chainidβ Print the resulting image's chain ID--refresh=""β Refresh token for authorization server--skip-metadataβ Skips metadata for unused platforms (Image may be unable to be pushed without metadata)--skip-verify,-kβ Skip SSL certificate validation--snapshotter=""β Snapshotter name. Empty value stands for the default value.--sync-fsβ Synchronize the underlying filesystem containing files when unpack images,falseby default--tlscacert=""β Path to TLS root CA--tlscert=""β Path to TLS client certificate--tlskey=""β Path to TLS client key--user,-u=""βUser[:password]Registry user and password
π push
Push an image to a remote. Send it, bestie. π
--allow-non-distributable-blobsβ Allow pushing blobs that are marked as non-distributable--hosts-dir=""β Custom hosts configuration directory--http-dumpβ Dump all HTTP request/responses when interacting with container registry--http-traceβ Enable HTTP tracing for registry interactions--localβ Push content from local client rather than using transfer service--manifest=""β Digest of manifest--manifest-type=""β Media type of manifest digest (default:"application/vnd.oci.image.manifest.v1+json")--max-concurrent-uploaded-layers=""β Set the max concurrent uploaded layers for each push (default:0)--plain-httpβ Allow connections using plain HTTP--platform=""β Push content from a specific platform--refresh=""β Refresh token for authorization server--skip-verify,-kβ Skip SSL certificate validation--tlscacert=""β Path to TLS root CA--tlscert=""β Path to TLS client certificate--tlskey=""β Path to TLS client key--user,-u=""βUser[:password]Registry user and password
π§Ή prune
Remove unused images
--allβ Remove all unused images, not just dangling ones (ifallis not specified no images will be pruned)
β οΈ Not me warning you twice: without --all, no images will be pruned. Like, zero. Nothing happens. So pass it or go home. π
π delete, del, remove, rm
Remove one or more images by reference
--syncβ Synchronously remove image and all associated resources
π·οΈ tag
Tag an image
--forceβ Forcetarget_refto be created, regardless if it already exists--localβ Run tag locally rather than through transfer API--skip-reference-checkβ Skip the strict check for reference names
π label
Set and clear labels for an image
--replace-all,-rβ Replace all labels
π¦ convert
Convert an image
--all-platformsβ Exports content from all platforms--erofs=""β Convert layers to EROFS format, must specify'raw'or'zstd'(e.g.--erofs raw,--erofs zstd)--erofs-compressors=""β Specify compression algorithm list when converting EROFS layers--erofs-mkfs-options=""β Extramkfsoptions applied when converting EROFS layers. (e.g.'-Efragments,dedupe')--ociβ Convert Docker media types to OCI media types--platform=""β Pull content from a specific platform--uncompressβ Converttar.gzlayers to uncompressed tar layers
π build-erofs-cache
Build an erofs layer content cache from an image's layers
--compressors=""β EROFS per-block compression algorithm(s), e.g.'lz4','deflate','zstd'; empty means uncompressed--dmverityβ Generate a dm-verity hash tree and.dmveritysidecar for each blob (Linux only)--mkfs-options=""β Extramkfs.erofsoptions (e.g.'-Efragments,dedupe')--platform=""β Cache layers for a specific platform (default: host platform)
π usage
Display usage of snapshots for a given image ref
--snapshotter=""β Snapshotter name. Empty value stands for the default value.
ποΈ leases
Manage leases. Iconic resource-holding behaviour, honestly.
π list, ls
List all active leases
--quiet,-qβ Print only the blob digest
β¨ create
Create lease
--expires,-x=""β Expiration of lease (0value will not expire) (default:24h0m0s)--id=""β Set the id for the lease, will be generated by default
π delete, del, remove, rm
Delete a lease
--syncβ Synchronously remove leases and all unreferenced resources
π«§ namespaces, namespace, ns
Manage namespaces. Three names, one job, we love a versatile queen. π
π± create, c
Create a new namespace
π list, ls
List namespaces
--quiet,-qβ Print only the namespace name
π§½ remove, rm
Remove one or more namespaces
--cgroup,-cβ Delete the namespace's cgroup
π label
Set and clear labels for a namespace
π¬ pprof
Provide golang pprof outputs for containerd. Science time, bestie. π§
--debug-socket,-d=""β Socket path for containerd's debug server (default:"/run/containerd/debug.sock")
π§ block
Goroutine blocking profile
--debug=""β Debug pprof args (default:0)
π§΅ goroutines
Dump goroutine stack dump
--debug=""β Debug pprof args (default:2)
β°οΈ heap
Dump heap profile
--debug=""β Debug pprof args (default:0)
π₯ profile
CPU profile
--debug=""β Debug pprof args (default:0)--seconds,-s=""β Duration for collection (seconds) (default:30s)
πͺ‘ threadcreate
Goroutine thread creating profile
--debug=""β Debug pprof args (default:0)
π€οΈ trace
Collect execution trace
--debug=""β Debug pprof args (default:0)--seconds,-s=""β Trace time (seconds) (default:5s)
πβοΈ run πβοΈ
okay so run is literally how you birth a container into the world β¨ here is every single flag it takes, no skips, no cap:
--allow-new-privsβ turn off the OCI spec'sNoNewPrivilegesfeature flag.--annotation=""β specify additional OCI annotations, e.g.foo=bar.--apparmor-default-profile=""β enable AppArmor with the default profile under the specified name, e.g."cri-containerd.apparmor.d".--apparmor-profile=""β enable AppArmor with an existing custom profile.--blockio-class=""β name of the blockio class to associate the container with.--blockio-config-file=""β file path to blockio class definitions. by default class definitions are not loaded, bestie.--cap-add=""β add Linux capabilities (set capabilities with'CAP_'prefix).--cap-drop=""β drop Linux capabilities (set capabilities with'CAP_'prefix).--cgroup=""β cgroup path. to disable use of cgroup, set to""explicitly.--cniβ enable cni networking for the container.--config,-c=""β path to the runtime-specific spec config file.--cpu-period=""β limit CPU CFS period (default:0).--cpu-quota=""β limit CPU CFS quota (default:-1).--cpu-shares=""β set the cpu shares (default:1024).--cpus=""β set the CFS cpu quota (default:0).--cpuset-cpus=""β set the CPUs the container will run in, e.g.1-2,4.--cpuset-mems=""β set the memory nodes the container will run in, e.g.1-2,4.--cwd=""β specify the working directory of the process.--detach,-dβ detach from the task after it has started execution. cannot be used with--rm, so pick a lane.--device=""β file path to a device to add to the container; or a path to a directory tree of devices to add to the container.--dump-config=""β dump the generated OCI config to a file.--env=""β specify additional container environment variables, e.g.FOO=bar.--env-file=""β specify additional container environment variables in a file, e.g.FOO=bar, one per line.--fifo-dir=""β directory used for storing IO FIFOs.--gidmap=""β run inside a user namespace with the specified GID mapping ranges; format iscontainer-gid:host-gid:length.--gpus=""β add gpus to the container.--hostname=""β set the container's host name.--label=""β specify additional labels, e.g.foo=bar.--log-uri=""β log uri.--memory-limit=""β memory limit (in bytes) for the container (default:0).--mount=""β specify additional container mount, e.g.type=bind,src=/tmp,dst=/host,options=rbind:ro.--net-hostβ enable host networking for the container.--no-pivotβ disable use of pivot-root (linux only).--null-ioβ send all IO to/dev/null.--pid-file=""β file path to write the task's pid.--platform=""β run image for specific platform.--privilegedβ run privileged container.--privileged-without-host-devicesβ don't pass all host devices to privileged container.--rdt-class=""β name of the RDT class to associate the container with. specifies a Class of Service (CLOS) for cache and memory bandwidth management.--read-onlyβ set the containers filesystem as readonly.--remap-labelsβ provide the user namespace ID remapping to the snapshotter via label options; requires snapshotter support.--rlimit-nofile=""β setRLIMIT_NOFILE(soft:hard).--rmβ remove the container after running. cannot be used with--detach, so again, pick a lane.--rootfsβ use custom rootfs that is not managed by containerd snapshotter.--rootfs-propagation=""β set the propagation of the container rootfs.--runc-binary=""β specify runc-compatible binary.--runc-root=""β specify runc-compatible root.--runc-systemd-cgroupβ start runc with systemd cgroup manager.--runtime=""β runtime name or absolute path to runtime binary (default:"io.containerd.runc.v2").--runtime-config-path=""β optional runtime config path.--sandbox=""β create the container in the given sandbox.--seccompβ enable the default seccomp profile.--seccomp-profile=""β file path to custom seccomp profile.seccompmust be set to true before usingseccomp-profile.--snapshotter=""β snapshotter name. empty value stands for the default value.--snapshotter-label=""β labels added to the new snapshot for this container.--sync-fsβ synchronize the underlying filesystem containing files when unpack images,falseby default.--tty,-tβ allocate a TTY for the container.--uidmap=""β run inside a user namespace with the specified UID mapping ranges; format iscontainer-uid:host-uid:length.--user,-u=""β username or user id, group optional (format:[:]).--with-ns=""β specify existing Linux namespaces to join at container runtime (format':').
πΈ snapshots, snapshot πΈ
manage snapshots. here is the top-level flag:
--snapshotter=""β snapshotter name. empty value stands for the default value.
commit
commit an active snapshot into the provided name.
diff
get the diff of two snapshots. the default second snapshot is the first snapshot's parent, cute.
--keepβ keep diff content. up to creator to delete it.--label=""β labels to attach to the image.--media-type=""β media type to use for creating diff (default:"application/vnd.oci.image.layer.v1.tar+gzip").--ref=""β content upload reference to use.
info
get info about a snapshot.
list, ls
list snapshots.
mounts, m, mount
mount gets mount commands for the snapshots.
--tempβ mounts the snapshot mounts as a temp mount and returns a bind mount.
prepare
prepare a snapshot from a committed snapshot.
--mountsβ print out snapshot mounts as JSON.--target,-t=""β mount target path, will print mount, if provided.
delete, del, remove, rm
remove snapshots.
label
add labels to content.
tree
display tree view of snapshot branches.
unpack
unpack applies layers from a manifest to a snapshot.
--snapshotter=""β snapshotter name. empty value stands for the default value.--sync-fsβ synchronize the underlying filesystem containing files when unpack images,falseby default.
usage
usage snapshots.
-bβ display size in bytes.
view
create a read-only snapshot from a committed snapshot.
--mountsβ print out snapshot mounts as JSON.--target,-t=""β mount target path, will print mount, if provided.
π§΅ tasks, t, task π§΅
manage tasks. no top-level flags, just vibes and subcommands.
attach
attach to the IO of a running container.
checkpoint
checkpoint a container.
--exitβ stop the container after the checkpoint.--image-path=""β path to criu image files.--work-path=""β path to criu work files and logs.
delete, del, remove, rm
delete one or more tasks.
--exec-id=""β process ID to kill.--force,-fβ force delete task process.
exec
execute additional processes in an existing container.
--cwd=""β working directory of the new process.--detach,-dβ detach from the task after it has started execution.--exec-id=""β exec specific id for the process.--fifo-dir=""β directory used for storing IO FIFOs.--log-uri=""β log uri for custom shim logging.--tty,-tβ allocate a TTY for the container.--user=""β user id or name.
list, ls
list tasks.
--quiet,-qβ print only the task id.
kill
signal a container (default: SIGTERM).
--all,-aβ send signal to all processes inside the container.--exec-id=""β process ID to kill.--signal,-s=""β signal to send to the container.
metrics, metric
get a single data point of metrics for a task with the built-in Linux runtime.
--format=""β"table"or"json"(default:"table").
pause
pause an existing container.
ps
list processes for container.
resume
resume a paused container.
start
start a container that has been created.
--detach,-dβ detach from the task after it has started execution.--fifo-dir=""β directory used for storing IO FIFOs.--log-uri=""β log uri.--no-pivotβ disable use of pivot-root (linux only).--null-ioβ send all IO to/dev/null.--pid-file=""β file path to write the task's pid.
π¦ install π¦
install a new package.
--libs,-lβ install libs from the image.--path=""β set an optional install path other than the managed opt directory.--replace,-rβ replace any binaries or libs in the opt directory.
πͺ oci πͺ
OCI tools.
spec
see the output of the default OCI spec.
--platform=""β platform of the spec to print (examples:'linux/arm64','windows/amd64').
ποΈ sandboxes, sandbox, sb, s ποΈ
manage sandboxes.
run, create, c, r
run a new sandbox.
--runtime=""β runtime name (default:"io.containerd.runc.v2").
list, ls
list sandboxes.
--filters=""β the list of filters to apply when querying sandboxes from the store.
remove, rm
remove sandboxes.
--force,-fβ ignore shutdown errors when removing sandbox.
info, i
get info about a sandbox.
βΉοΈ info βΉοΈ
print the server info.
β οΈ deprecations β οΈ
list
print warnings for deprecations.
--format=""β output format to use (examples:'default','json').
π§ shim π§
interact with a shim directly.
--id=""β shim ID.--shim-address=""β shim address (default: computed from shim ID).
delete
delete a container with a task.
exec
exec a new process in the task's container.
--attach,-aβ stay attached to the container and open the fifos.--cwd=""β current working directory.--env,-e=""β add environment vars.--spec=""β runtime spec.--stderr=""β specify the path to the stderr fifo.--stdin=""β specify the path to the stdin fifo.--stdout=""β specify the path to the stdout fifo.--tty,-tβ enable tty support.
start
start a container with a task.
state
get the state of all main process of the task.
--api-version=""β shim API version{2,3}(default:3).--task-id,-t=""β task ID.
shutdown
shutdown shim if there is no active container.
--api-version=""β shim API version{2,3}(default:3).
pprof
provide golang pprof outputs for containerd-shim.
block
goroutine blocking profile.
--debug=""β output format, value =0: binary, value >0: plaintext (default:0).
goroutines
print goroutine stack dump.
--debug=""β output format, value =0: binary, value >0: plaintext (default:2).
heap
dump heap profile.
--debug=""β output format, value =0: binary, value >0: plaintext (default:0).
profile
CPU profile.
--debug=""β output format, value =0: binary, value >0: plaintext (default:0).--seconds,-s=""β duration for collection (seconds) (default:30s).
threadcreate
goroutine thread creating profile.
--debug=""β output format, value =0: binary, value >0: plaintext (default:0).
trace
collect execution trace.
--debug=""β output format, value =0: binary, value >0: plaintext (default:0).--seconds,-s=""β trace time (seconds) (default:5s).
and that's a wrap on ctr(8) bestie! source/version: ctr(8), date: whatever the page header says β you already peeped it. go slay the container game, no cap ππ¦β¨
π¦ where this page comes from
- arch rolling: containerd 2.4.2-1 Β· Apache-2.0
- fedora 44: containerd 2.4.2-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms