Docker networking for services communicating over JGroups

I’m trying to create a network(ipvlan or something else) which should be expose to my public network(home network). I need to ping the container with IP from different devices in same network.

docker network create -d ipvlan --subnet=192.168.161.0/24 --gateway=192.168.161.155 -o parent=eth1 my_ipvlan_net

docker run -itd --rm --network my_ipvlan_net --ip 192.168.161.79 --name testbox busybox

i can ping this IP from my host device but not exposed to the network :melting_face:.

My config: Windows pc with vagrant box contains docker containers
UseCase: I need to containerize my java service which need to be in my network so that it communicate over jGroup and joins in cluster. (JGroup bind ports should be in home network)

suggest some ideas for this use case, feel free to provide some other approach too :upside_down_face:.

“You can use the ‘Macvlan Network Driver,’ and each container will get its own IP address in the same subnet as the host, allowing them to be accessed directly from the external network.”

“Or you can set up a ‘Bridge network with port forwarding,’ use a ‘Proxy or Reverse Proxy,’ or utilize the ‘Linux-only Networking Mode.’”

1 Like