gpt4 book ai didi

docker - 如果容器崩溃了,docker镜像又如何呢?

转载 作者:行者123 更新时间:2023-12-03 16:21:38 31 4
gpt4 key购买 nike

我认为,容器是图像的运行实例。如果容器崩溃了,例如运行sudo rm -f /删除所有东西怎么办,docker镜像仍然可以吗?

最佳答案

在这两种情况下对图像都没有影响。
查看是否通过docker run创建了新容器,实际上是新层

enter image description here

When you create a new container, you add a new, thin, writable layer on top of the underlying stack. This layer is often called the “container layer”. All changes made to the running container - such as writing new files, modifying existing files, and deleting files - are written to this thin writable container layer. The diagram below shows a container based on the Ubuntu 15.04 image. src



这个stackopverflow讨论也可能会有所帮助:
Docker image vs container

关于docker - 如果容器崩溃了,docker镜像又如何呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38796006/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com