Forrest logo
back to the docker tool

docker:tldr:72bb9

docker: Stop one or more running containers.
$ docker container stop ${container_name}
try on your machine

The command "docker container stop ${container_name}" is used to stop a running Docker container.

Here's a breakdown of each part of the command:

  • "docker" is the command-line interface for managing Docker containers and images.
  • "container" is the subcommand that deals with containers.
  • "stop" is the action to stop a container.
  • "${container_name}" is a placeholder for the name or ID of the container you want to stop. You need to replace "${container_name}" with the actual name or ID of the container you want to stop.

By running this command, Docker will send a SIGTERM signal to the specified container, requesting it to stop gracefully. If the container does not respond to the SIGTERM signal within a certain time (default 10 seconds), Docker will send a SIGKILL signal, forcefully terminating the container.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.

Questions that are answered by this command:

  • distrobox auto stop container on exit?
back to the docker tool