zoukankan      html  css  js  c++  java
  • crt task

    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
    
    

  • 相关阅读:
    CentOS 7 修改时区
    flink与kafka结合
    Kafka 原理和实战
    kafka单机多节点部署
    使用yumdownloadonly下载RPM包及依赖包
    使用Onvif协议进行设备发现以及指定设备信息探测
    kafka相关脚本操作
    Python入门篇-基础语法
    Python入门篇-pyenv安装及应用
    zabbix Server 4.0监控Flume关键参数
  • 原文地址:https://www.cnblogs.com/dream397/p/13842324.html
Copyright © 2011-2022 走看看