Technical questionAccepted answer
ERROR: 2 matches found based on name: network <nameofservice>_default is ambiguous
Dupinder Singh
Sep 7
0 views1
I was building docker image using the command
docker-compose -f "docker-compose.yml" up -d --build
But it returns me an error
ERROR: 2 matches found based on name: network officeconverter_default is ambiguous
This is a bit clear that in my machine there are two networks with the same name trying to exists.
Question is how to remove the networks from docker networks
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
1 answer
Accepted answer · original discussion
Dupinder Singh
PermalinkSep 7
The solution is simple!
just remove the networks.
like 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
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
zayquanPermalink
Jan 6
I encountered the same issue. I created the problem by running the same
docker-compose -f <DOCKER-COMPOSE-FILE> up -d command simultaneously. As an aside this was because a jest test suite attempted to execute two integration tests in parallel, where a setup step of the integration test was to perform a docker compose. I was able to solve the issue by running docker network prune but be wary this may remove more networks than you wanted. This was ok for me because I was on a dev laptop with nothing important WRT docker config. Hope this helps