创建新Dockant容器时出现“The containseer name "/xxx" is already in ous txt书 container xxxxxxxxxxx...”问题的外理
创建新Docker容器时出现“The container name "/xxx" is already in use by container xxxxxxxxxxx...”问题的解决办法
1.详细错误提示:
/usr/bin/docker-current: Error response from daemon: Conflict. The container name "/rabbitmq" is already in use by container
8278c2b3d8ded022cf2baa3e0c41c339733331cd6e5b21720bc5db10d8afe7a. You have to remove (or rename) that container to be able to
reuse that name..
2.下面举例说明,列出本地镜像:
3.创建新的容器:(rabbitmq)
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq 5335b737c380
(上面创建新容器出现了错误,提示:容器名被占用,须移除或重命名后才能使用这个容器名。)
4.先查看所有的容器:
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESe9ab55123cc8 kiban
6.4.3 "/usr/local/bin/ki..." 5 weeks ago Exited (137) 11 minutes ago kibanaa45eb1980ab8 rabbitmq
"/usr/local/bin/do..." 5 weeks ago Exited (143) 11 minutes ago rabbitmqc15d671e01b8 mobz
/elasticsearch-head:5 "/bin/sh -c 'grunt..." 5 weeks ago Exited (137) 5 weeks ago zen_kalam
看到了这个名为 “rabbitmq” 的容器,并且这个容器是非运行(Exited)状态。
注:“docker ps” 是查看当前运行的容器,“docker ps -a” 是查看所有容器(包括停止的)。
5.移除这个“rabbitmq”容器:
docker rm 5335b737c380
6.再看,容器已经移除:
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESe9ab55123cc8 kiban6.
4.3 "/usr/local/bin/ki..." 5 weeks ago Exited (137) 11 minutes ago kibanac15d671e01b8 mobz
/elasticsearch-head:5 "/bin/sh -c 'grunt..." 5 weeks ago Exited (137) 5 weeks ago zen_kalam
7.然后再创建新容器:
docker run -d -p 5672:5672 -p 15672:15672 --name rabbitmq 5335b737c380
(image_id 记得替换)
8.新容器创建成功,并且是运行状态:
docker ps -a
9.Ok,问题解决!
以上是 创建新Dockant容器时出现“The containseer name "/xxx" is already in ous txt书 container xxxxxxxxxxx...”问题的外理 的全部内容, 来源链接: utcz.com/a/50589.html