Stop a Container
There are two primary ways to stop a running container:
docker stop: This stops the container by issuing aSIGTERMsignal to the container. You’ll typically want to usedocker stopto allow the container to shut down gracefully.docker kill: This stops the container by issuing aSIGKILLsignal to the container. This is a more forceful way to stop a container, and should be used as a last resort.
Stopping a Container
To stop a container, first use docker ps to find the container ID.
docker ps
Copy the container ID, then run the stop command:
# Replace CONTAINER_ID with your actual container ID
docker stop CONTAINER_ID