首页 > 其他 > 详细

crt task

时间:2020-10-19 21:31:19      阅读:61      评论:0      收藏:0      [点我收藏+]

 

1.[root@containerd busybox]# cd /root/busybox
2.利用containerd cli (/usr/local/bin/ctr)运行容器
[root@containerd busybox]# ctr run -t -d --rootfs rootfs busybox /bin/sh
[root@containerd busybox]# ctr container list
CONTAINER IMAGE RUNTIME
busybox - io.containerd.runtime.v1.linux
[root@containerd busybox]# ps -ef |grep container
root 9539 1 0 21:22 ? 00:00:03 /usr/local/bin/containerd
root 15285 9539 0 22:02 ? 00:00:00 containerd-shim -namespace default -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/default/busybox -address /run/containerd/containerd.sock -containerd-binary /usr/local/bin/containerd -debug
3.登录容器验证
[root@containerd busybox]# ctr tasks list
TASK PID STATUS
busybox 15301 RUNNING
[root@containerd busybox]# ctr tasks exec -t --exec-id 15301 busybox /bin/sh
/ # hostname
containerd
/ # ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
4.stop容器
[root@containerd busybox]# ctr tasks kill --signal 9 busybox
[root@containerd busybox]# ctr tasks list
TASK PID STATUS
busybox 15301 STOPPED
5.删除容器
[root@containerd busybox]# ctr container delete busybox
[root@containerd busybox]# ctr container list
CONTAINER IMAGE RUNTIME


 

技术分享图片

 

 

技术分享图片

 

crt task

原文:https://www.cnblogs.com/dream397/p/13842324.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!