Home >Operation and Maintenance >Docker >What is the difference between stop and pause in docker?
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...]InstancePause the database container db01 to provide services.
docker pause db01Restore database container db01 to provide services.
docker unpause db01docker start: Start one or more stopped containers docker stop: Stop a running container docker restart: Restart the containerSyntax
docker start [OPTIONS] CONTAINER [CONTAINER...] docker stop [OPTIONS] CONTAINER [CONTAINER...] docker restart [OPTIONS] CONTAINER [CONTAINER...]ExampleStart the stopped container myrunoob
docker start myrunoobStop the running container myrunoob
docker stop myrunoobRestart the container myrunoob
docker restart myrunoobRecommended learning: "
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!