启动/删除Docker容器时出现问题 - 如何修复

 

使用Docker过程中,运行docker-compose up或docker run时,出现Conflict. The name W is already in use by container XYZ. You have to delete..或"Conflict, cannot remove the default name of the container..." 

或:Conflict. The name "XYZ" is already in use by container hexacode. You have to delete (or rename) that container to be able to reuse that name.

 

我们无法启动容器,因为该名称已在使用中。运行docker ps命令,又看不到。

 

运行docker ps -a

 

找到你的容器,复制它的Id号,然后运行:

 

docker rm 85c2981e63f6 26ea04f41ab3 

 

删除后,再运行docker-compose up

 

第二种方法是

从/ var下手动删除剩余的文件。具体来说,可以在/ var / lib / docker / containers /下找到这些文件。每个容器目录都有一个超长的哈希标识符,里面有大量丑陋的JSON输出。如果搜索与所需容器名称匹配的特定字符串,则会找到包含其配置文件的相关目录。

删除与名称搜索匹配的父目录,然后重新启动Docker服务。之后,您应该可以再次使用您的名字。

posted @   树下水月  阅读(214)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
点击右上角即可分享
微信分享提示