Docker Community Forums

Share and learn in the Docker community.

Can't get network traffic flowing in both directions simultaneously

We have a Java app inside a container running Spring Boot and is bound to port 8082. On the host machine (running Windows) we have MSSQL and is bound to the default port of 1433. We can’t seem to get traffic to flow in both directions at the same time. If I set –network=host then the Java app can reach MSSQL on the host machine but then from the host machine I can’t make HTTP requests on port 8082 going to the Java app. If I set –network=bridge (the default mode) then the opposite is true.

inbound 8082 works, outbound 1433 doesn’t:
docker run --network="bridge" -p 8082:8082 72dbcb9dae51

outbound 1433 works, inbound 8082 doesn’t:
docker run --network="host" 72dbcb9dae51

(the -p switch is ignored when running in host mode)

There may be some issues related to the fact we’re running Docker on Windows, but you would think if we can get it to work in both directions, just not at the same time, then it would be possible to make that happen.

We suspect iptables needs adjusting, but we’re also not having any luck just trying to modify the rules:

  1. Tried adding “–iptables=false” to the “docker run” command but it complains that it’s not a valid option.

  2. Tried connecting to the VM over SSH so that we can run the iptables command but we’re unable to connect to the VM using SSH.

  3. Tried using the container CLI that Docker Desktop provides, but that seems to be a pretty useless shell—most useful commands don’t exist, just the basic stuff like traversing directories. Iptables is not available via the CLI and apparently there are some switches you can add when running Docker to enable access to iptables but that didn’t work.

  4. Tried adding “iptables:false” to the JSON config that the daemon uses (via the GUI).

Thanks,
Tony