加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

unix – 删除使用`docker ps -f status = created`列出的Docker

发布时间:2020-12-16 03:48:34 所属栏目:安全 来源:网络整理
导读:我已经看过帖子显示如何删除用docker ps -q -f status = exited列出的已退出容器,但我还想清理created而不是running容器.删除具有“已创建”状态的容器是否安全,或者是否存在缺点? 最佳答案 具有已创建状态的Docker容器是从图像创建但从未启动的容器.删除它

我已经看过帖子显示如何删除用docker ps -q -f status = exited列出的已退出容器,但我还想清理’created’而不是’running’容器.删除具有“已创建”状态的容器是否安全,或者是否存在缺点?

最佳答案
具有已创建状态的Docker容器是从图像创建但从未启动的容器.删除它们没有任何影响,因为您不会在容器中运行任何进程并导致更改所创建容器的状态,在以后的情况下需要提交.这通常是为了加快启动容器并确保所有配置都准备就绪.

Refer Docker Docs

The docker create command creates a writeable container layer over the
specified image and prepares it for running the specified command. The
container ID is then printed to STDOUT. This is similar to docker run
-d except the container is never started. You can then use the docker start command to start the container at any point.

This is useful when you want to set up a container configuration ahead
of time so that it is ready to start when you need it. The initial
status of the new container is created.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读