![docker factory reset command docker factory reset command](https://docker-docs.netlify.app/docker-for-mac/images/menu/prefs-disk.png)
Note: The command shown in the snapshot will only work if the container status is ‘exited’, we have to use the first command mentioned above if the container is in a different state or change the status in the command. In the above snapshot, we can see that we have 3 stopped containers and all stopped containers have been successfully started. We can do so as shown below:ĭocker start $(docker ps -q -f “status=exited”) Step 4: Let’s assume we have multiple containers in exited status that we want to start using a single command. In the above example, we can see that the default page is again accessible after starting the container. Step 1: Let’s create an nginx container using the below command and access the default page using curl:ĭocker run -d -p 80:80 -name my-nginx nginx:alpineĬurl Step 2: Now, stop this the container using the ‘docker stop’ command and try to access localhost:Ĭurl Step 3: Let’s start the container again but this time using the ‘docker start’ command as we want to just start the stopped container, don’t want to create a new one. Example #1: Start One or Multiple Stopped Containers Let’s understand more about this command with a few examples. This command is simply going to start the container, however, we can use a few flags to control few things like connecting to the container once it is started, attaching STDOUT/STDERR, etc. when starting the container if it is not configured while running or creating that container. We can not expose port, give it a name, attach volumes, etc. When we run this command from the CLI with container name passed as an argument, Docker CLI makes an API call to the Docker daemon and daemon starts that container if the container is in the stopped state or in the created state. The ‘docker start’ works in the same way other commands work in Docker.