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