User Tools

Site Tools


docker:containers:start_a_container

Docker - Containers - Start a Container

Containers are started using either the docker start command; or the docker run command.

  • Docker Start: Launch a previously stopped container.
    • For example, if you had stopped a container with the command docker stop CONTAINER_ID, you can relaunch the same container with the command docker start CONTAINER_ID, and the data and settings will be the same.
  • Docker run: Create a new container of an image, and execute the container.
    • You can create N clones of the same image. The command is: docker run IMAGE_ID and not docker run CONTAINER_ID.

Start a Container

docker start nginx-container

Start a Container by ID

Find the ID of the container using the docker ps command.

docker start ad6d2272092a

Start Multiple Stopped Containers

docker start nginx-container httpd-container

Start a new Docker Container from an Image

docker run -itd --name=nginx-container nginx
docker/containers/start_a_container.txt · Last modified: 2022/09/19 14:38 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki