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.
2条答案
按热度按时间e4eetjau1#
根据Docker documentation,docker-compose暂停命令执行以下操作:
j2cgzkjk2#
Docket docs的内容如下:
docker pause命令挂起指定容器中的所有进程。在Linux上,此命令使用cgroups freezer。传统上,挂起进程时使用SIGSTOP信号,该信号可由被挂起的进程观察到。使用cgroups freezer,进程不知道也无法捕获它正在被挂起,然后恢复。在Windows上,只能暂停Hyper-V容器。
因此,这意味着容器中的进程停止运行,并且可以在以后恢复。