I would like to connect a windows and a linux container within the same network.
First I create a network (Docker for Windows is set to "Windows Containers"):
docker network create --driver nat mynet
The network is created and docker network ls lists the new network.
docker-compose.yml of the windows and the linux service contain:
version: "3"
services:
...
networks:
mynet: {}
networks:
mynet:
external: true
With docker-compose up the windows container starts fine, after "Switch to Linux Containers" and trying to start the linux container the following error is shown:
ERROR: Network mynet declared as external, but could not be found. Please create the network manually using
docker network create mynetand try again.
Also docker network ls does not list the network anymore.
What would be the correct way to share a network between windows and linux?