启动/删除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服務。之后,您應該可以再次使用您的名字。
總結
以上是生活随笔為你收集整理的启动/删除Docker容器时出现问题 - 如何修复的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Python实现网络爬虫】Scrapy
- 下一篇: Oracle作业3