【问题标题】:How to remove more than one container in a single command?如何在单个命令中删除多个容器?
【发布时间】:2020-12-18 12:24:44
【问题描述】:

如何在一个命令中删除多个容器? 我有一些要删除的容器:mynginx2mynginx1

【问题讨论】:

    标签: docker containers


    【解决方案1】:

    使用以下命令:

    docker rm mynginx2 mynginx1
    

    Usage:  docker rm [OPTIONS] CONTAINER [CONTAINER...]
    
    Remove one or more containers
    
    Options:
      -f, --force     Force the removal of a running container (uses SIGKILL)
          --help      Print usage
      -l, --link      Remove the specified link
      -v, --volumes   Remove anonymous volumes associated with the container
    

    参考: https://docs.docker.com/engine/reference/commandline/rm/

    【讨论】:

      【解决方案2】:

      使用带逗号的删除命令

      docker 容器 rm mynginx2, mynginx1

      【讨论】:

        猜你喜欢
        • 2018-04-09
        • 1970-01-01
        • 2015-02-24
        • 2020-06-25
        • 2013-03-02
        • 1970-01-01
        • 2019-01-11
        • 2021-11-22
        • 1970-01-01
        相关资源
        最近更新 更多