Stop a Container

There are two primary ways to stop a running container:

  1. docker stop: This stops the container by issuing a SIGTERM signal to the container. You’ll typically want to use docker stop to allow the container to shut down gracefully.
  2. docker kill: This stops the container by issuing a SIGKILL signal 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