The difference between stop and pause in docker: 1. The stop command is used to stop a running container, and the pause command is used to pause all processes in the container; 2. Using the stop command, the main process in the container will be in the specified It will be killed within the specified time, which defaults to ten seconds. Using the pause command will suspend all processes in the specified container.
The operating environment of this tutorial: linux7.3 system, docker version 19.03, Dell G3 computer.
Create a container and run it
docker run # 创建容器并运行
Pause and unpause
docker pause # 暂停运行容器 docker unpause # 取消暂停
Stop and start
docker stop # 停止运行容器 docker start # 开始运行容器
The difference between docker pause and docker stop
#The docker pause command suspends all processes in the specified container
docker stop The main process in the container will be killed within the specified time, the default is 10s
docker pause: Pause all processes in the container.
docker stop: Stop a running container
##Expand knowledge
docker pause CONTAINER [CONTAINER...] docker unpause CONTAINER [CONTAINER...]
docker pause db01
docker unpause db01
docker start [OPTIONS] CONTAINER [CONTAINER...] docker stop [OPTIONS] CONTAINER [CONTAINER...] docker restart [OPTIONS] CONTAINER [CONTAINER...]
docker start myrunoob
docker stop myrunoob
docker restart myrunoob
docker video tutorial"
The above is the detailed content of What is the difference between stop and pause in docker?. For more information, please follow other related articles on the PHP Chinese website!