Docker - Name is already in use by container
Asked 07 September, 2021
Viewed 1.9K times
  • 65
Votes

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 to prevent this error ?

19 Answer