Ubuntu 18.04 host
Docker 18.09.0 / API 1.39
Container is built from ubuntu:latest and installs nginx, php-fpm, Oracle OCI8 and MSSQL php extensions. Drivers show up fine in php info page. And I can access the oracle DB since it is on the same network as the docker host but the remote MSSQL server is unreachable.
PHP/MSSQL client works fine from servers not inside containers, but even after following the docs to enable forwarding I still can’t communicate. My daemon.json only contains dns server settings and I have restarted networking on the host and restarted the docker service in hopes this would “take effect” but it’s not working.
I enabled:
$ sysctl net.ipv4.conf.all.forwarding=1
And then ran:
$ sudo iptables -P FORWARD ACCEPT
The output from my IP tables:
Chain INPUT (policy ACCEPT)
target prot opt source destinationChain FORWARD (policy ACCEPT)
target prot opt source destination
DOCKER-USER all – anywhere anywhere
DOCKER-ISOLATION-STAGE-1 all – anywhere anywhere
ACCEPT all – anywhere anywhere ctstate RELATED,ESTABLISHED
DOCKER all – anywhere anywhere
ACCEPT all – anywhere anywhere
ACCEPT all – anywhere anywhereChain OUTPUT (policy ACCEPT)
target prot opt source destinationChain DOCKER (1 references)
target prot opt source destination
ACCEPT tcp – anywhere 172.17.0.2 tcp dpt:httpChain DOCKER-ISOLATION-STAGE-1 (1 references)
target prot opt source destination
DOCKER-ISOLATION-STAGE-2 all – anywhere anywhere
RETURN all – anywhere anywhereChain DOCKER-ISOLATION-STAGE-2 (1 references)
target prot opt source destination
DROP all – anywhere anywhere
RETURN all – anywhere anywhereChain DOCKER-USER (1 references)
target prot opt source destination
RETURN all – anywhere anywhere