错误:根据名称找到2个匹配项:network officeconverter_default不明确

问题描述

我正在使用命令构建docker图像

docker-compose -f "docker-compose.yml" up -d --build 

但是它返回了一个错误

ERROR: 2 matches found based on name: network officeconverter_default is ambiguous

这很明显,我的机器中有两个名称相同的网络试图存在。

问题是如何从docker网络中删除网络

PS E:\repos\Github\officeconverter> docker network ls
NETWORK ID          NAME                        DRIVER              ScopE
868c88a83bd6        bridge                      bridge              local
92f7d20ed432        officeconverter_default     bridge              local
3f96cfb7b591        officeconverter_default     bridge              local

解决方法

试试: docker network prune

这将删除您的所有网络。

,

解决方案很简单!

只需删除网络即可。

docker network rm <network Id> <space> <network Id> ....

PS E:\repos\Github\officeconverter> docker network rm 92f7d20ed432 3f96cfb7b591
92f7d20ed432
3f96cfb7b591
PS E:\repos\Github\officeconverter> docker network ls
NETWORK ID          NAME                        DRIVER              SCOPE
868c88a83bd6        bridge                      bridge              local
,

对我有用的解决方案是:

docker system prune -af
docker volume prune --force

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...