Home >Operation and Maintenance >Docker >What is the difference between stop and rm commands in docker?
Difference: The stop command is used to stop the container; and the rm command is a deletion command. If used directly, the corresponding container will be deleted. Note: docker stop first sends a SIGTERM signal to the container, allowing it to perform some operations within a certain period of time. If the container does not stop within this period, it sends a SIGKILL signal to forcibly kill the container.
The difference between stop and rm commands in docker
The stop command is used to stop the container.
docker stop: First send the SIGTERM signal to the container, allowing it to perform some operations within a certain period of time (default 10s). If the container does not stop during this period, send the SIGKILL signal to forcibly kill the container;
# 停止一个容器 $docker stop Name/ID
The rm command is a deletion command. If used directly, it will delete the corresponding container.
# 删除所有容器 $docker rm `docker ps -a -q` # 删除单个容器; -f, --force=false; -l, --link=false Remove the specified link and not the underlying container; -v, --volumes=false Remove the volumes associated to the container $docker rm Name/ID
Recommended tutorials: "docker tutorial", "PHP tutorial"
The above is the detailed content of What is the difference between stop and rm commands in docker?. For more information, please follow other related articles on the PHP Chinese website!