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

后端 未结 18 2021
暖寄归人
暖寄归人 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:51

    When you are building a new image you often want to run a new container each time and with the same name. I found the easiest way was to start the container with the --rm option:

    --rm        Automatically remove the container when it exits
    

    e.g.

    docker run --name my-micro-service --rm 
    

    Sadly it's used almost randomly in the examples from the docs

提交回复
热议问题