What is exactly happening when you're Docker C

2019-02-20 12:58发布

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?

1条回答
劳资没心,怎么记你
2楼-- · 2019-02-20 13:24

As mentioned in 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.

If this behavior is undesired, set the --pause option to false.

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()

查看更多
登录 后发表回答