Menu Close

Docker – Start docker container

We will help you to understand how to start docker container. For this, we use “docker start” command with various options.

docker start” command starts one or more stopped containers..

Command:

docker start container_name_1 container_name_2 …

How docker start command works ?

  • docker start command triggers docker engine to start docker container.
  • It starts the stopped container.
  • If the given container name is not present then docker engine throws the error as “No such container: container_name

Example:

% docker start ubuntu

% docker ps
CONTAINER IDIMAGECOMMANDCREATEDSTATUSPORTSNAMES

9b815c2b0d3c

ubuntu:latest

“bash”

22 hours ago

Up 22 hours

 

ubuntu

You can also start container with various options.

Name, shorthandDescription
--attach , -aAttach STDOUT/STDERR and forward signals
–detach-keysOverride the key sequence for detaching a container
--interactive , -iAttach container’s STDIN

Example:

% docker start -a ubuntu

It will start ubuntu container and will expect input from STDIN.

To learn more about docker, Pls click given below link.

https://www.techieindoor.com/category/docker/

References:

https://en.wikipedia.org/wiki/Docker_(software)

Posted in docker

Leave a Reply

Your email address will not be published.

Contact Us