暂停泊坞容器

时间:2017-10-13 09:50:02

标签: docker docker-compose

暂停容器是什么意思?特别是暂停流程意味着什么?

https://docs.docker.com/compose/reference/pause/

2 个答案:

答案 0 :(得分:2)

根据Docker documentation,docker-compose pause命令执行此操作:

The docker pause command suspends all processes in the specified containers. 
On Linux, this uses the cgroups freezer. Traditionally, when suspending a process the SIGSTOP signal is used, which is observable by the process being suspended. 
With the cgroups freezer the process is unaware, and unable to capture, that it is being suspended, and subsequently resumed. On Windows, only Hyper-V containers can be paused.

答案 1 :(得分:1)

这些是Docket docs所说的:

  

docker pause命令挂起指定容器中的所有进程。在Linux上,它使用cgroups冷冻器。传统上,当暂停进程时,使用SIGSTOP信号,该进程被暂停可观察到。使用cgroups冷冻器,该过程不知道,无法捕获,它被暂停,随后恢复。在Windows上,只能暂停Hyper-V容器。

因此,这意味着容器中的进程停止运行,并且可以在以后恢复。