Search code examples
dockerweblogicdocker-swarm

Weblogic port binding in Docker container


I manually installed weblogic, configured domain inside a Docker container [Overlay network - Docker swarm].

[root@host ~]# docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
e3f32e71cc16        bridge              bridge              local
26628a46774c        docker_gwbridge     bridge              local
20c80427519f        host                host                local
9ejgeett1y4y        ingress             overlay             swarm
52d14f492cda        none                null                local
f628wowngc6z        myoverlay           overlay             swarm

After starting the Admin Server, I see that the admin server port 7001 is bound to only the overlay interface and not to the ANY interface 0.0.0.0. So, even though I exposed the 7001 port when creating container, I am not able to access it from external public network.

[root@host /]# netstat -anp | grep 7001
tcp        0      0 10.0.0.5:7001           0.0.0.0:*               LISTEN      8168/java

[root@host /]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
265: eth0@if266: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default
    link/ether 02:42:0a:00:00:05 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.0.0.5/24 scope global eth0
       valid_lft forever preferred_lft forever
267: eth1@if268: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
    link/ether 02:42:ac:13:00:06 brd ff:ff:ff:ff:ff:ff link-netnsid 1
    inet 172.19.0.6/16 scope global eth1
       valid_lft forever preferred_lft forever

I also started sshd in the same container, but this was bound to the 0.0.0.0 ANY interface.

[root@host /]# netstat -anp | grep 22
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1/sshd

I need weblogic admin server console to be accessible to public network, not just within the overlay network containers. So, how to bind weblogic admin server port to all interfaces (0.0.0.0) ?


Solution

  • Problem lies in Weblogic configuration. If Listen address is set to empty, weblogic itself will bind the port to all interfaces. This solved my problem.