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

栏目: 编程工具 · 发布时间: 5年前

内容简介:使用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. Y

使用 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服务。之后,您应该可以再次使用您的名字。


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Web ReDesign 2.0

Web ReDesign 2.0

Kelly Goto、Emily Cotler / Peachpit Press / 2004-12-10 / USD 45.00

If anything, this volume's premise--that the business of Web design is one of constant change-has only proven truer over time. So much so, in fact, that the 12-month design cycles cited in the last ed......一起来看看 《Web ReDesign 2.0》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具