docker:tldr:1adac
The docker start
command is used to start one or more stopped containers.
When a container is stopped, it still retains all its configuration and data, but it is not actively running. The docker start
command allows you to restart a stopped container, allowing it to continue from where it left off.
The basic syntax of the docker start
command is:
docker start [OPTIONS] CONTAINER [CONTAINER...]
where [OPTIONS]
are the various flags that can be used with the command, and [CONTAINER...]
is a list of one or more container names or IDs.
Some commonly used options for the docker start
command include:
-a
or--attach
: Attach STDOUT/STDERR and forward signals to the container. This allows you to view the output or interact with the container directly.-i
or--interactive
: Keep STDIN open even if not attached. This keeps the container running and allows you to provide inputs to the container.
For example, to start a container with the name "my-container", you can use the following command:
docker start my-container
This will start the "my-container" container if it was previously stopped. Once the container is started, it will resume its execution from where it was paused or stopped.
Note that if a container was created with the --restart
flag set to "unless-stopped" or similar, it will automatically start when Docker daemon starts. But the docker start
command is used to manually start a stopped container.