Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - Name is already in use by container

Tags:

docker

Running the docker registry with below command always throws an error:

dev:tmp me$ docker run \      -d --name registry-v1 \      -e SETTINGS_FLAVOR=local \      -e STORAGE_PATH=/registry \      -e SEARCH_BACKEND=sqlalchemy \      -e LOGLEVEL=DEBUG \      -p 5000:5000 \      registry:0.9.1 Error response from daemon: Conflict. The name "registry-v1" is already in use by container f9e5798a82e0. You have to delete (or rename) that container to be able to reuse that name. 

How can I prevent this error ?

like image 788
Rubytastic Avatar asked Jul 29 '15 10:07

Rubytastic


People also ask

How do I rename a docker container?

To rename docker container, use the rename sub-command as shown, in the following example, we renaming the container discourse_app to a new name disc_app. After renaming a containers, confirm that it is now using the new name.

Can not remove docker container?

To remove one or more Docker containers, use the docker container rm command, followed by the IDs of the containers you want to remove. If you get an error message similar to the one shown below, it means that the container is running. You'll need to stop the container before removing it.


1 Answers

I got confused by this also. There are two commands relevant here:

docker run  # Run a command in a **new** container 
docker start  # Start one or more stopped containers 
like image 123
Walt Howard Avatar answered Sep 18 '22 19:09

Walt Howard