I am trying to create multiple containers using testcontainers lib which are sharing the same Network. What do I have right now is the following:
network = Network.newNetwork();
container1 = new GenericContainer<>().withNetwork(network)...
container2 = new GenericContainer<>().withNetwork(network)...
// variables' type and other builder details omitted for brevity
The container startup works fine, but when I do a docker inspect for each of these containers, I see that only container1 is assigned to the freshly created network. Any reason why this is happening?