Docker Community Forums

Share and learn in the Docker community.

Docker Networking Question

I have an Ubuntu server connected to a management VLAN on its native/default NIC, with a second (tenGig) NIC connected to a switch port that contains multiple other VLANs.

One of my containers needs to access a cifs/smb file system mount on an external system in one of the other VLANs (separate from management), but it appears the only way I can do this is through a docker volume or if my Ubuntu server mounts it locally – both solutions will cause the CIFS file system traffic to traverse my routers / go across subnets.

Is there any way I can have a container mount a cifs file system from itself, on the second NIC from the IP address I’m assigning to the macvlan network in docker-compose? Or should I just give up and put the main server within that VLAN that it needs to perform the CIFS mount and forget the separate management link?

I did try adding an IP address for the CIFS server VLAN for the Ubuntu server, but things got weird when I would SSH into the server from there, (due to bound traffic for SSH coming in via the mgmt VLAN, while the return path would want to go direct layer 2 back out the other VLAN due to my source IP).

tl;dr Is it possible to have a docker image mount a file system (say CIFS/smb) from the IP -within- the container?