【问题标题】:Does containerd provide any way to pause containers like in Docker?containerd 是否提供任何方法来暂停容器,例如在 Docker 中?
【发布时间】:2019-10-31 02:28:18
【问题描述】:

Docker 提供this 机制来暂停容器。

containerd 中是否有等价物,还是我必须找到另一种“冻结”容器的方法?

目标是进行一致的备份 - 我正在寻找另一种解决方案,而不是使用 fsfreeze

【问题讨论】:

    标签: docker containerd


    【解决方案1】:

    Containerd 有自己的 cli,称为 ctr

    ctr 似乎不支持暂停容器。

    这是目前似乎支持的内容:

    $ ctr container
    NAME:
       ctr containers - manage containers
    
    USAGE:
       ctr containers command [command options] [arguments...]
    
    COMMANDS:
         create           create container
         delete, del, rm  delete one or more existing containers
         info             get info about a container
         list, ls         list containers
         label            set and clear labels for a container
    
    OPTIONS:
       --help, -h  show help
    
    

    如果您可以使用 docker cli,请使用 docker pause 来暂停容器。

    如果您的设置有可用的runc,则使用runc pause

    【讨论】:

      【解决方案2】:

      您是否在使用 containerd 客户端包
      如果是这样,在containerd 包中有一个方法Pause 和另一个Resume。这些方法允许您暂停/恢复任务。

      可以找到源代码here

      【讨论】:

        猜你喜欢
        • 2021-07-14
        • 2022-06-30
        • 2010-10-04
        • 1970-01-01
        • 1970-01-01
        • 2019-02-18
        • 2020-06-24
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多