"docker container start" - Start Container

Q

How to start a stopped container on the Docker Engine with "docker container start" command?

✍: FYIcenter.com

A

In order to use the "docker container start" or "docker start" command, we need to know the container ID or name.

1. Get the ID or name of a stopped container from the output of the "docker container list --all" command:

$ docker container list --all

CONTAINER ID  IMAGE        COMMAND            CREATED      STATUS                  NAMES
96ce071457fc  hello-world  "/hello"           6 hours ago  Exited (0) 6 hours ago  gracious_wilson
e744e7509b13  tomcat       "catalina.sh run"  8 hours ago  Exited (1) 8 hours ago  blissful_herschel

2. Start a container by name:

$ docker container start gracious_wilson
gracious_wilson

$ docker ps
CONTAINER ID  IMAGE        COMMAND   CREATED      STATUS        NAMES
96ce071457fc  hello-world  "/hello"  6 hours ago  Up 8 seconds  gracious_wilson

3. Stop a container by ID:

$ docker container stop 96ce071457fc
gracious_wilson

$ docker container list --all 
CONTAINER ID  IMAGE        COMMAND   CREATED      STATUS                    NAMES
96ce071457fc  hello-world  "/hello"  6 hours ago  Exited (0) 7 seconds ago  gracious_wilson

 

"docker container rm" - Remove Container

"docker container list --all" - List All Containers

Docker Client (or CLI) on Ubuntu

⇑⇑ Docker Container Platform - Tutorials

2019-06-04, 205👍, 0💬