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

后端 未结 18 2081
暖寄归人
暖寄归人 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 09:10

    The OP's problem is the error. Deleting state isn't the only solution - or even a good one. The problem is docker run isn't re-entrant, and docker start is impotent w/o run. So we have to combine them.

    For example to run Postgres w/o destroying previous state, try this:

    docker start postgres || docker run -d -p 5432:5432 --name postgres -e POSTGRES_PASSWORD=password postgres:13-alpine
    

提交回复
热议问题