1ctr(8)()                                                              ctr(8)()
2
3
4
5       ctr  is  an unsupported debug and administrative client for interacting
6       with the containerd daemon. Because it is  unsupported,  the  commands,
7       options, and operations are not guaranteed to be backward compatible or
8       stable from release to release of the containerd project.
9
10
11
12
13
14

NAME

16       ctr
17
18
19

SYNOPSIS

21       ctr
22
23
24              [--address|-a]=[value]
25              [--connect-timeout]=[value]
26              [--debug]
27              [--namespace|-n]=[value]
28              [--timeout]=[value]
29
30
31
32       Usage:
33
34
35              ctr [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]
36
37
38
39

GLOBAL OPTIONS

41       --address,  -a="":  address  for  containerd's  GRPC  server  (default:
42       /run/containerd/containerd.sock)
43
44
45       --connect-timeout="":  timeout  for  connecting to containerd (default:
46       0s)
47
48
49       --debug: enable debug output in logs
50
51
52       --namespace, -n="": namespace to use with commands (default: default)
53
54
55       --timeout="": total timeout for ctr commands (default: 0s)
56
57
58

COMMANDS

plugins, plugin

61       provides information about containerd plugins
62
63
64   list, ls
65       lists containerd plugins
66
67
68       --detailed, -d: print detailed information about each plugin
69
70
71       --quiet, -q: print only the plugin ids
72
73

version

75       print the client and server versions
76
77

containers, c, container

79       manage containers
80
81
82   create
83       create container
84
85
86       --allow-new-privs: turn off OCI spec's NoNewPrivileges feature flag
87
88
89       --config, -c="": path to the runtime-specific spec config file
90
91
92       --cwd="": specify the working directory of the process
93
94
95       --device="": add a device to a container
96
97
98       --env="": specify  additional  container  environment  variables  (i.e.
99       FOO=bar)
100
101
102       --env-file="":  specify additional container environment variables in a
103       file(i.e. FOO=bar, one per line)
104
105
106       --gpus="": add gpus to the container (default: 0)
107
108
109       --label="": specify additional labels (i.e. foo=bar)
110
111
112       --memory-limit="": memory limit (in bytes) for the container  (default:
113       0)
114
115
116       --mount="":     specify     additional     container     mount     (ex:
117       type=bind,src=/tmp,dst=/host,options=rbind:ro)
118
119
120       --net-host: enable host networking for the container
121
122
123       --no-pivot: disable use of pivot-root (linux only)
124
125
126       --pid-file="": file path to write the task's pid
127
128
129       --privileged: run privileged container
130
131
132       --read-only: set the containers filesystem as readonly
133
134
135       --rootfs: use custom rootfs that is not managed by containerd snapshot‐
136       ter
137
138
139       --runtime="": runtime name (default: io.containerd.runc.v2)
140
141
142       --seccomp: enable the default seccomp profile
143
144
145       --snapshotter="":  snapshotter name. Empty value stands for the default
146       value.
147
148
149       --tty, -t: allocate a TTY for the container
150
151
152       --with-ns="": specify existing Linux namespaces to  join  at  container
153       runtime (format ':')
154
155
156   delete, del, rm
157       delete one or more existing containers
158
159
160       --keep-snapshot: do not clean up snapshot with container
161
162
163   info
164       get info about a container
165
166
167   list, ls
168       list containers
169
170
171       --quiet, -q: print only the container id
172
173
174   label
175       set and clear labels for a container
176
177
178   checkpoint
179       checkpoint a container
180
181
182       --image: include the image in the checkpoint
183
184
185       --rw: include the rw layer in the checkpoint
186
187
188       --task: checkpoint container task
189
190
191   restore
192       restore a container from checkpoint
193
194
195       --live: restore the runtime and memory data from the checkpoint
196
197
198       --rw: restore the rw layer from the checkpoint
199
200

content

202       manage content
203
204
205   active
206       display active transfers
207
208
209       --root="": path to content store root (default: /tmp/content)
210
211
212       --timeout, -t="": total timeout for fetch (default: 0s)
213
214
215   delete, del, remove, rm
216       permanently delete one or more blobs
217
218
219   edit
220       edit a blob and return a new digest
221
222
223       --editor="": select editor (vim, emacs, etc.)
224
225
226       --validate="":  validate  the result against a format (json, mediatype,
227       etc.)
228
229
230   fetch
231       fetch all content for an image into containerd
232
233
234       --all-metadata: Pull metadata for all platforms
235
236
237       --all-platforms: pull content from all platforms
238
239
240       --label="": labels to attach to the image
241
242
243       --metadata-only: Pull all metadata including manifests and configs
244
245
246       --plain-http: allow connections using plain HTTP
247
248
249       --platform="": Pull content from a specific platform
250
251
252       --refresh="": refresh token for authorization server
253
254
255       --skip-verify, -k: skip SSL certificate validation
256
257
258       --user, -u="": user[:password] Registry user and password
259
260
261   fetch-object
262       retrieve objects from a remote
263
264
265       --plain-http: allow connections using plain HTTP
266
267
268       --refresh="": refresh token for authorization server
269
270
271       --skip-verify, -k: skip SSL certificate validation
272
273
274       --user, -u="": user[:password] Registry user and password
275
276
277   get
278       get the data for an object
279
280
281   ingest
282       accept content into the store
283
284
285       --expected-digest="": verify content against expected digest
286
287
288       --expected-size="": validate against provided size (default: 0)
289
290
291   list, ls
292       list all blobs in the store
293
294
295       --quiet, -q: print only the blob digest
296
297
298   push-object
299       push an object to a remote
300
301
302       --plain-http: allow connections using plain HTTP
303
304
305       --refresh="": refresh token for authorization server
306
307
308       --skip-verify, -k: skip SSL certificate validation
309
310
311       --user, -u="": user[:password] Registry user and password
312
313
314   label
315       add labels to content
316
317

events, event

319       display containerd events
320
321

images, image, i

323       manage images
324
325
326   check
327       check that an image has all content available locally
328
329
330       --snapshotter="": snapshotter name. Empty value stands for the  default
331       value.
332
333
334   export
335       export images
336
337
338       --all-platforms: exports content from all platforms
339
340
341       --platform="": Pull content from a specific platform
342
343
344       --skip-manifest-json: do not add Docker compatible manifest.json to ar‐
345       chive
346
347
348   import
349       import images
350
351
352       --all-platforms: imports content for all platforms, false by default
353
354
355       --base-name="": base image name for added images,  when  provided  only
356       images with this name prefix are imported
357
358
359       --compress-blobs:  compress  uncompressed  blobs when creating manifest
360       (Docker format only)
361
362
363       --digests: whether to create digest images (default: false)
364
365
366       --index-name="": image name to keep index as, by default index is  dis‐
367       carded
368
369
370       --no-unpack: skip unpacking the images, false by default
371
372
373       --snapshotter="":  snapshotter name. Empty value stands for the default
374       value.
375
376
377   list, ls
378       list images known to containerd
379
380
381       --quiet, -q: print only the image refs
382
383
384   pull
385       pull an image from a remote
386
387
388       --all-metadata: Pull metadata for all platforms
389
390
391       --all-platforms: pull content and metadata from all platforms
392
393
394       --label="": labels to attach to the image
395
396
397       --plain-http: allow connections using plain HTTP
398
399
400       --platform="": Pull content from a specific platform
401
402
403       --refresh="": refresh token for authorization server
404
405
406       --skip-verify, -k: skip SSL certificate validation
407
408
409       --snapshotter="": snapshotter name. Empty value stands for the  default
410       value.
411
412
413       --user, -u="": user[:password] Registry user and password
414
415
416   push
417       push an image to a remote
418
419
420       --manifest="": digest of manifest
421
422
423       --manifest-type="":  media  type  of manifest digest (default: applica‐
424       tion/vnd.oci.image.manifest.v1+json)
425
426
427       --plain-http: allow connections using plain HTTP
428
429
430       --refresh="": refresh token for authorization server
431
432
433       --skip-verify, -k: skip SSL certificate validation
434
435
436       --user, -u="": user[:password] Registry user and password
437
438
439   remove, rm
440       remove one or more images by reference
441
442
443       --sync: Synchronously remove image and all associated resources
444
445
446   tag
447       tag an image
448
449
450       --force: force target_ref to  be  created,  regardless  if  it  already
451       exists
452
453
454   label
455       set and clear labels for an image
456
457
458       --replace-all, -r: replace all labels
459
460

leases

462       manage leases
463
464
465   list, ls
466       list all active leases
467
468
469       --quiet, -q: print only the blob digest
470
471
472   create
473       create lease
474
475
476       --expires,  -x="":  expiration  of  lease  (0  value  will  not expire)
477       (default: 24h0m0s)
478
479
480       --id="": set the id for the lease, will be generated by default
481
482
483   delete, rm
484       delete a lease
485
486
487       --sync: Synchronously remove leases and all unreferenced resources
488
489

namespaces, namespace, ns

491       manage namespaces
492
493
494   create, c
495       create a new namespace
496
497
498   list, ls
499       list namespaces
500
501
502       --quiet, -q: print only the namespace name
503
504
505   remove, rm
506       remove one or more namespaces
507
508
509       --cgroup, -c: delete the namespace's cgroup
510
511
512   label
513       set and clear labels for a namespace
514
515

pprof

517       provide golang pprof outputs for containerd
518
519
520       --debug-socket,  -d="":  socket  path  for  containerd's  debug  server
521       (default: /run/containerd/debug.sock)
522
523
524   block
525       goroutine blocking profile
526
527
528   goroutines
529       dump goroutine stack dump
530
531
532   heap
533       dump heap profile
534
535
536   profile
537       CPU profile
538
539
540       --seconds, -s="": duration for collection (seconds) (default: 30s)
541
542
543   threadcreate
544       goroutine thread creating profile
545
546
547   trace
548       collect execution trace
549
550
551       --seconds, -s="": trace time (seconds) (default: 5s)
552
553

run

555       run a container
556
557
558       --allow-new-privs: turn off OCI spec's NoNewPrivileges feature flag
559
560
561       --cgroup="":  cgroup  path (To disable use of cgroup, set to "" explic‐
562       itly)
563
564
565       --config, -c="": path to the runtime-specific spec config file
566
567
568       --cwd="": specify the working directory of the process
569
570
571       --detach, -d: detach from the task after it has started execution
572
573
574       --device="": add a device to a container
575
576
577       --env="": specify  additional  container  environment  variables  (i.e.
578       FOO=bar)
579
580
581       --env-file="":  specify additional container environment variables in a
582       file(i.e. FOO=bar, one per line)
583
584
585       --fifo-dir="": directory used for storing IO FIFOs
586
587
588       --gpus="": add gpus to the container (default: 0)
589
590
591       --label="": specify additional labels (i.e. foo=bar)
592
593
594       --log-uri="": log uri
595
596
597       --memory-limit="": memory limit (in bytes) for the container  (default:
598       0)
599
600
601       --mount="":     specify     additional     container     mount     (ex:
602       type=bind,src=/tmp,dst=/host,options=rbind:ro)
603
604
605       --net-host: enable host networking for the container
606
607
608       --no-pivot: disable use of pivot-root (linux only)
609
610
611       --null-io: send all IO to /dev/null
612
613
614       --pid-file="": file path to write the task's pid
615
616
617       --platform="": run image for specific platform
618
619
620       --privileged: run privileged container
621
622
623       --read-only: set the containers filesystem as readonly
624
625
626       --rm: remove the container after running
627
628
629       --rootfs: use custom rootfs that is not managed by containerd snapshot‐
630       ter
631
632
633       --runtime="": runtime name (default: io.containerd.runc.v2)
634
635
636       --seccomp: enable the default seccomp profile
637
638
639       --snapshotter="":  snapshotter name. Empty value stands for the default
640       value.
641
642
643       --tty, -t: allocate a TTY for the container
644
645
646       --with-ns="": specify existing Linux namespaces to  join  at  container
647       runtime (format ':')
648
649

snapshots, snapshot

651       manage snapshots
652
653
654       --snapshotter="":  snapshotter name. Empty value stands for the default
655       value.
656
657
658   commit
659       commit an active snapshot into the provided name
660
661
662   diff
663       get the diff of two snapshots. the default second snapshot is the first
664       snapshot's parent.
665
666
667       --keep: keep diff content. up to creator to delete it.
668
669
670       --label="": labels to attach to the image
671
672
673       --media-type="": media type to use for creating diff (default: applica‐
674       tion/vnd.oci.image.layer.v1.tar+gzip)
675
676
677       --ref="": content upload reference to use
678
679
680   info
681       get info about a snapshot
682
683
684   list, ls
685       list snapshots
686
687
688   mounts, m, mount
689       mount gets mount commands for the snapshots
690
691
692   prepare
693       prepare a snapshot from a committed snapshot
694
695
696       --target, -t="": mount target path, will print mount, if provided
697
698
699   remove, rm
700       remove snapshots
701
702
703   label
704       add labels to content
705
706
707   tree
708       display tree view of snapshot branches
709
710
711   unpack
712       unpack applies layers from a manifest to a snapshot
713
714
715       --snapshotter="": snapshotter name. Empty value stands for the  default
716       value.
717
718
719   usage
720       usage snapshots
721
722
723       -b: display size in bytes
724
725
726   view
727       create a read-only snapshot from a committed snapshot
728
729
730       --target, -t="": mount target path, will print mount, if provided
731
732

tasks, t, task

734       manage tasks
735
736
737   attach
738       attach to the IO of a running container
739
740
741   checkpoint
742       checkpoint a container
743
744
745       --exit: stop the container after the checkpoint
746
747
748       --image-path="": path to criu image files
749
750
751       --work-path="": path to criu work files and logs
752
753
754   delete, rm
755       delete one or more tasks
756
757
758       --exec-id="": process ID to kill
759
760
761       --force, -f: force delete task process
762
763
764   exec
765       execute additional processes in an existing container
766
767
768       --cwd="": working directory of the new process
769
770
771       --detach, -d: detach from the task after it has started execution
772
773
774       --exec-id="": exec specific id for the process
775
776
777       --fifo-dir="": directory used for storing IO FIFOs
778
779
780       --log-uri="": log uri for custom shim logging
781
782
783       --tty, -t: allocate a TTY for the container
784
785
786   list, ls
787       list tasks
788
789
790       --quiet, -q: print only the task id
791
792
793   kill
794       signal a container (default: SIGTERM)
795
796
797       --all, -a: send signal to all processes inside the container
798
799
800       --exec-id="": process ID to kill
801
802
803       --signal, -s="": signal to send to the container
804
805
806   pause
807       pause an existing container
808
809
810   ps
811       list processes for container
812
813
814   resume
815       resume a paused container
816
817
818   start
819       start a container that have been created
820
821
822       --detach, -d: detach from the task after it has started execution
823
824
825       --fifo-dir="": directory used for storing IO FIFOs
826
827
828       --log-uri="": log uri
829
830
831       --null-io: send all IO to /dev/null
832
833
834       --pid-file="": file path to write the task's pid
835
836
837   metrics, metric
838       get  a  single data point of metrics for a task with the built-in Linux
839       runtime
840
841
842       --format="": "table" or "json" (default: table)
843
844

install

846       install a new package
847
848
849       --libs, -l: install libs from the image
850
851
852       --path="": set an optional install path  other  than  the  managed  opt
853       directory
854
855
856       --replace, -r: replace any binaries or libs in the opt directory
857
858

shim

860       interact with a shim directly
861
862
863       --id="": container id
864
865
866   delete
867       delete a container with a task
868
869
870   exec
871       exec a new process in the task's container
872
873
874       --attach, -a: stay attached to the container and open the fifos
875
876
877       --cwd="": current working directory
878
879
880       --env, -e="": add environment vars
881
882
883       --spec="": runtime spec
884
885
886       --stderr="": specify the path to the stderr fifo
887
888
889       --stdin="": specify the path to the stdin fifo
890
891
892       --stdout="": specify the path to the stdout fifo
893
894
895       --tty, -t: enable tty support
896
897
898   start
899       start a container with a task
900
901
902   state
903       get the state of all the processes of the task
904
905
906
907                                                                      ctr(8)()
Impressum