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

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

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


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

查看所有标签

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

Hadoop: The Definitive Guide

Hadoop: The Definitive Guide

Tom White / O'Reilly Media, Inc. / 2009 / 44.99

Apache Hadoop is ideal for organizations with a growing need to store and process massive application datasets. Hadoop: The Definitive Guide is a comprehensive resource for using Hadoop to build relia......一起来看看 《Hadoop: The Definitive Guide》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具