Docker Community Forums

Share and learn in the Docker community.

Trying to Access Docker Container from Remote Desktop

Docker version 1.13.1, build 7056c0e

/sbin/sysctl -w net.ipv4.conf.all.forwarding=1

docker run -d --memory=3G -p 10.27.46.21:1621:1521 --publish-all=true --name mercheric store/oracle/database-enterprise:12.2.0.1

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
02918348c683 store/oracle/database-enterprise:12.2.0.1 “/bin/sh -c '/bin/…” 5 minutes ago Up 5 minutes (healthy) 10.27.46.21:1621->1521/tcp, 0.0.0.0:9002->5500/tcp mercheric

[root@hq-xdb01 ~]# netstat -anlp | grep 1621
tcp 0 0 10.27.46.21:1621 0.0.0.0:* LISTEN 299452/docker-proxy

[root@hq-xdb01 ~]# telnet 10.27.46.21 1621
Trying 10.27.46.21…
telnet: connect to address 10.27.46.21: Connection refused

[root@hq-xdb01 ~]# service iptables status | grep -i 1621
4 DNAT tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:1621 to:172.17.0.2:1521
5 DNAT tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:1621 to:172.17.0.2:1521
6 DNAT tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:1621 to:172.17.0.2:1521
7 DNAT tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:1621 to:172.17.0.2:1521
8 DNAT tcp – 0.0.0.0/0 0.0.0.0/0 tcp dpt:1621 to:172.17.0.2:1521
11 DNAT tcp – 0.0.0.0/0 10.27.46.21 tcp dpt:1621 to:172.17.0.2:1521
13 DNAT tcp – 0.0.0.0/0 10.27.46.21 tcp dpt:1621 to:172.17.0.2:1521

Any ideas on the

telnet: connect to address 10.27.46.21: Connection refused

This works from connecting from HOST => Container

it doesn’t work from

EXTERNAL HOST (DESKTOP PC) => Container using the HOST IP and port 1621 which should direct to docker VM