docker error - 'name is already in use by container'

后端 未结 18 2108
暖寄归人
暖寄归人 2020-12-12 08:14

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

dev:tmp me$ docker run \\
     -d --name registry-v1 \\
     -e SETTINGS_         


        
18条回答
  •  心在旅途
    2020-12-12 08:54

    Cause

    A container with the same name is still existing.

    Solution

    To reuse the same container name, delete the existing container by:

    docker rm 
    

    Explanation

    Containers can exist in following states, during which the container name can't be used for another container:

    • created
    • restarting
    • running
    • paused
    • exited
    • dead

    You can see containers in running state by using :

    docker ps
    

    To show containers in all states and find out if a container name is taken, use:

    docker ps -a
    

提交回复
热议问题