Docker 101 : Error response from daemon: Conflict. The container name "/container_name" is already in use by container



When we try to run a container using the "docker run" command, sometimes we get the below error:

Error response from daemon: Conflict. The container name "/debian-image" is already in use by container.

We have this error because we are trying to run a container that already exists, but it is stopped using:


Listing all the containers (stopped and running):


From the displayed list we can get the name of the container we want to start.

Starting a "stopped" container:

To start a (stopped) container that already exists on the system, we need to use the start command (in our case the name of the container is "debian-image" from the "docker ps" command):


Stopping a running container:

We can stop a container using the below command:


Comments

Leave as a comment:

Archive