Docker承诺容器时正在发生什么? [英] What is exactly happening when you're Docker Commiting a container?

查看:110
本文介绍了Docker承诺容器时正在发生什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道当你使用 docker commit abcdefgh ola / minhaimagem:1.0 时,您正在从 abcdefgh 容器中保存更改成为一个新的形象,以便再次使用它。但是,我注意到有时提交运行速度非常慢,而且这个事实在我脑海里提出了这个问题,在提交运行时究竟发生了什么?我的意思是,发生什么事情?

I know that when you use, for example, docker commit abcdefgh ola/minhaimagem:1.0 you are saving your changes from the abcdefgh container into a new image to use it again futurely. However, i noticed that sometimes the commit runs very slow and that fact arised the question in my mind, what does exactly is happening while the commit is running? I mean, what is happening under the hood?

推荐答案

docker commit


默认情况下,正在提交的容器及其进程将在图像提交时暂停。这可以减少在创建提交过程中遇到数据损坏的可能性。

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.

该步骤(等待进程暂停)花费时间。

That step (waiting for the processes to pause) can take time.


如果此行为是不需要的,请设置 - 暂停选项

您可以在 api / server / router / image / image_routes.go#postCommit() ,然后通过后端路由到 daemon / commit.go#Commit()

You can see the actual commit call in api/server/router/image/image_routes.go#postCommit() which is then routed through a backend to daemon/commit.go#Commit()

这篇关于Docker承诺容器时正在发生什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆