我可以暂停然后恢复Docker容器吗?
问题描述:
我想暂停Docker容器并稍后恢复。如何才能做到这一点?
通过挂起,我的意思是它应该保存正在进行的过程的状态(例如,视频编码),然后随时恢复它。
I would like to suspend a Docker container and resume later. How can this be done? By suspending I mean that it should save the state of ongoing process (e.g. video encoding) and then resume it back at any time.
答
截至版本0.12.0 ,Docker支持 PAUSE
和 UNPAUSE
命令来使用cgroup Freezer暂停和恢复容器。
As of Version 0.12.0, Docker supports PAUSE
and UNPAUSE
commands to pause and resume containers using cgroup freezer.