You have to remove (or rename) that container to be able to reuse that name.

问题

 The container name "/xiangheGuosanguan20200428" is already in use by container "8f2f22451b0a9aa54c18e6c68a28d676afb5d533e3f8d8f213e4f90652200ac0". You have to remove (or rename) that container to be able to reuse that name.

原因

已经有容器使用这个了。必须删除(或重命名)该容器才能重用该名称。

解决

先查看所有容器 找到你要部署的项目已经存在的容器,拿到他的CONTAINER-ID

命令1

查看运行的容器

docker ps -a

在这里插入图片描述

命令2

写你的容器名

rm -f xiangheGuosanguan20200428
docker ps -a

先删除容器,然后查看你的docker,看到底删除了没,(一般不报错就是删除成功)看不看随你
在这里插入图片描述

命令3

运行你的容器

docker run -d --name xiangheGuosanguan20200428 -p 8429:8383 -e context-path=xiangheGuosanguan20200428 -e auth-Url= -e httpName=https xianghe_guosanguan202003                   09:2.0

无报错为成功,再次查看容器发现有了就对了在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/HezhezhiyuLe/article/details/106855311
今日推荐