目标是使容器从“干净”状态创建或启动更快,以便构建包含长时间运行的应用程序安装的映像。我认为在容器创建后立即docker export
有两个选项(在Windows上不支持)或者在容器创建后立即docker checkpoint
。
尝试检查Windows容器,
docker checkpoint create my_container my_container_checkpoint
命令似乎挂起,事件日志显示:
Index Time EntryType Source InstanceID Message
----- ---- --------- ------ ---------- -------
3595658 Feb 05 11:31 Information docker 2 debug: Calling GET /_ping
3595659 Feb 05 11:31 Information docker 2 debug: Calling GET /v1.35/containers/my_container/export
3595666 Feb 05 11:33 Information docker 2 debug: Calling POST /v1.35/containers/my_container/checkpoints
3595667 Feb 05 11:33 Information docker 2 debug: form data: {"CheckpointDir":"","CheckpointID":"my_container_checkpoint","Exit":true}
3595665 Feb 05 11:33 Information docker 2 debug: Calling GET /_ping
版本信息:
Version 17.12.0-ce-win47 (15139)
Channel: stable
9c692cd