I was trying to use the network "bridge"
to join services from different "docker-compose.yml"
and I was getting the following error:
Network-scoped alias is supported only for containers in user defined networks
Searching a bit, I came to this reference link:: https://github.com/docker/compose/issues/3012
I read and re-read everything several times, but I couldn't understand the real reason for using one or the other.
Can someone explain to me what the difference is in practice?
Why when you use network_mode
and run docker network inspect bridge
all containers correctly linked appear?
Before:
services:
local-db:
image: mysql
networks:
default:
external:
name: bridge
After:
local-db:
image: mysql
network_mode: bridge