Tools, FAQ, Tutorials:
"docker container start/stop" - Start/Stop Container
How to start a stopped container on the Docker Engine with "docker container start/stop" command?
✍: FYIcenter.com
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:
fyicenter$ docker container list --all CONTAINER ID IMAGE COMMAND STATUS NAMES 96ce071457fc hello-world "/hello" Exited (0) 6 hours ago gallant_kepler ...
2. Start a container by name:
fyicenter$ docker container start gallant_kepler gallant_kepler fyicenter$ docker ps CONTAINER ID IMAGE COMMAND STATUS NAMES 96ce071457fc hello-world "/hello" Up 8 seconds gallant_kepler
3. Stop a container by ID:
fyicenter$ docker container stop 96ce071457fc 96ce071457fc fyicenter$ docker container list --all CONTAINER ID IMAGE COMMAND STATUS NAMES 96ce071457fc hello-world "/hello" Exited (0) 7 seconds ago gallant_kepler
As you can see, "docker container stop" command terminates the running command of the target container. The exit code of the running command is reported in the STATUS column like "Exited (0)".
And "docker container stop" command starts the running command again of the target container.
⇒ "docker container stop/kill" - Stop/Kill Container
⇐ "docker container list --all" - List All Containers
2019-06-04, 1102🔥, 0💬
Popular Posts:
Can Two Forms Be Nested? Can two forms be nested? The answer is no and yes: No. You can not nest two...
Where to get a real Atom XML example? You can follow this tutorial to get a real Atom XML example: 1...
How to Install Docker Desktop on Windows 10? You can follow this tutorial to Install Docker Desktop ...
How to use the Atom Online Validator at w3.org? w3.org feed validation service is provided at http:/...
How to use "xsl-transform" Azure API Policy Statement? The "xsl-transform" Policy Statement allows y...