I want to connect a Linux container to a specific network adapter on a Windows host (host-only VMnet1) to allow connection between the Container and a Windows VM hosted on the same Windows host. The underlying desired connection between Container and VM is TCP to specific ports.
I have tried :- docker network create -d macvlan --gateway <> --subnet <> - o parent=eth0 app-network
I have also tried :- docker network create -d ipvlan --gateway <> --subnet <> - o parent=eth0 app-network
In each case, I set the gateway to the IP address of VMnet1 network adapter, with the sub net mask set to the subnet mask of VMnet1.
This does create a network without whinge and on running the Container app with devcontainer.json setting
the network to app-network, the container command line in VS code does show a container ip address within the subnet, but it does’nt provide the desired connectivity.
I have also tried :- docker network create -d transparent -o com.docker.network.windowsshim.interface=“VMnet1” app-network
However this bombs out with plugin “transparent” not found
I have got the impression from various Google searches that macvlan & ipvlan drivers are for Linux Containers with a Linux host and the transparent driver is for a Windows container and Windows host.
How can I achieve what I need to with a Linux container and a Windows host. I am unfortunately something of a newbie with Docker Containers and also a long way short of being a networking guru.
We are using Rancher Desktop 1.20 as a docker desktop with WSL 2 running.
Any help would be appreciated.