linux - 我应该在提交之前停止容器吗?

标签 linux docker containers

在大多数教程中,他们会在提交之前停止容器。 例如:https://docs.oracle.com/cd/E52668_01/E54669/html/section_c5q_n2z_fp.html

有一次我忘记在提交之前停止它。但是提交仍然成功完成!不知道有没有隐患。

最佳答案

默认情况下,docker 会在提交期间自动暂停容器,以确保它以一致的状态提交容器,因此提交正在运行的容器应该不是问题; from the docs :

By default, the container being committed and its processes will be paused while the image is committed. This reduces the likelihood of encountering data corruption during the process of creating the commit. If this behavior is undesired, set the ‘p’ option to false.

关于linux - 我应该在提交之前停止容器吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34868116/

相关文章:

docker - 从 macOS 主机访问 Docker 容器中的 USB 设备(不是内存棒)

logging - 日志级别作为 Docker GELF 日志记录驱动程序的字段

mysql - 如何让服务在退出docker后仍然运行?

docker - Webserver 无法通过 docker-compose 连接到 Redis

c++ - 以下结合了 erase 和 remove 的语法是什么意思?

c++ - 带有列表的 std::generate_n 函数

linux - Hbase shell 远程命令

c - 在多进程环境中读取文件时意外的 EOF

linux - 配置:错误:找不到库的版本

php - 如果启用了 libcurl,我可以假设所有 setopt 选项都可用吗?