提交一个 运行ning docker 容器(暂停),然后 运行 它,图像内部状态是什么

Committing a running docker container (with pause), then run it, what's the images internal state

假设我有一个 Python 程序 运行ning 在 docker 容器中

import time
counter = 0
while True:
   counter += 1
   print counter
   time.sleep(1)

如果我对那个 运行ning 容器进行提交,然后将那个新映像用于 运行 一个新容器,会发生什么情况?

文档指出 运行ning 容器已暂停(cgroups freezer),在提交后它会取消暂停。图像处于什么状态?信号终止?我假设 python 程序在对该图像执行 docker 启动时将不再 运行ning,对吗?

我问是因为我在容器中有几个 Java 服务器 (Atlassian) 运行ning,所以我想知道我是否通过在该容器上提交来进行每日备份,然后我 "restore" (docker 运行 ... backup/20160118) 其中一个备份,服务器将处于什么状态?

Docker commit 仅提交容器的 filesystem 更改,因此自容器启动以来在文件系统上添加、删除或修改的任何文件.

请注意,dockerfile 中的任何 volume--volumeVOLUME)都是 not 的一部分容器的文件系统,所以不会提交。

In-memory 状态:“检查点和恢复”

提交一个容器,包括它的当前 (in-memory) 状态,要复杂得多。此过程称为“检查点和还原”。您可以在 https://criu.org. There's currently a pull request to add basic support for checkpoint and restore to Docker; https://github.com/docker/docker/pull/13602 上找到更多相关信息,但该功能尚不支持将此类容器“迁移”到另一台机器。