Need help?

Our experts will login to your server within 30 minutes to fix urgent issues.

We will keep your servers stable, secure and fast at all times for one fixed price per month.

Docker run exited container – How to fix the error?

Are you looking for why the docker run exited the container?

We can help you to start an exited container with a docker start and docker attach.

At Bobcares, we often fix Docker errors, as a part of our Docker Hosting Support.

Today, let’s see why docker run exited containers and how our Support Engineers fix this error.


What does docker run do?

Docker is a container technology for provisioning applications quickly based on docker images.

A Dockerfile contains the specification of a docker image. To create a docker image from the Dockerfile we use the command docker run.

So, the docker run is a command to launch Docker containers.


Why containers exit on docker run?

Containers exit on docker run due to many reasons. And mostly this can happen due to improper setup of Dockerfile.

As we have said, docker run command launch docker container by reading Dockerfile. Any error in this can exit the container.

So, our Support Engineers check the Dockerfile and correct it.

For instance, changing the COPY command to AND command can fix this error. Later we need to start this exited container.


How to start this exited Docker container?

Now let’s check out how to start the exited containers. We can do this in two ways.


Start exited Docker container using container ID

Initially, we need to list the containers. The command to list them is,

docker ps

Whereas to list exited containers, our Support Engineers use the command,

docker ps -f "status=exited"

From here we can obtain the container ID. Then to start the container we use the command,

docker start <container ID>

Later to attach to this container we use the command,

docker attach <container ID>

If the above command doesn’t work then we use the below command,

docker start -a <container ID>

Here, -a option indicates attach. This starts and attaches the container.


Start the Docker container last created and exited

Alternatively, if the container just exited we can easily start it in a single step. For this, we use the command,

Docker run exited container.

Here `docker ps -q -l` replaces the container ID of the last created Docker container.

Additionally, we can also use options like -i to start the container in interactive mode.

[Need assistance in fixing Docker errors? – We can help you.]



So far, why docker run exited container. We also saw how our Support Engineers fixed this error and started an exited container.

Are you using Docker based apps?

There are proven ways to get even more out of your Docker containers! Let us help you.

Spend your time in growing business and we will take care of Docker Infrastructure for you.



Submit a Comment

Your email address will not be published. Required fields are marked *

Docker Support

Spend time on your business, not on your servers.

Managing a server is time consuming. Whether you are an expert or a newbie, that is time you could use to focus on your product or service. Leave your server management to us, and use that time to focus on the growth and success of your business.

TALK TO US Or click here to learn more.