docker-oracle-xe-11g icon indicating copy to clipboard operation
docker-oracle-xe-11g copied to clipboard

Default listener listens to wrong interface

Open KaiNahrgang opened this issue 8 years ago • 2 comments

Hi,

when running a wnameless/docker-oracle-xe-11g container using docker-compose with a configured link to another container, you got more than one interface. The listener listens to the docker interface of the host, but I expected that it listens to the docker-compose interface. Example: docker interface: eth1 IP: 172.18.0.4 docker-compose interface: eth2 IP: 10.0.0.5

/etc/hosts is also configured to use the eth2 IP: 10.0.0.5 f4c4a3638c11

hostname resolves into eth2 IP. The linked docker-compose container reaches the wnameless/docker-oracle-xe-11g container through the eth2 IP address as well.

Default listener:

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/xe)
      (PROGRAM = extproc)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
      (ADDRESS = (PROTOCOL = TCP)(HOST = f4c4a3638c11)(PORT = 1521))
    )
  )

DEFAULT_SERVICE_LISTENER = (XE)

A fix could be an environment variable that sets a specific interface or using the configured IP address in /etc/hosts instead of the hostname.

If you need more information please have a look at this link or just ask: https://stackoverflow.com/questions/46254132/jdbc-connection-between-docker-containers-docker-compose

KaiNahrgang avatar Sep 17 '17 10:09 KaiNahrgang

@KaiNahrgang I am having the same issue atm. Is there a work aroudn for this? Is the idea here that the HOST = 10.0.0.5 ?

cmosguy avatar Oct 17 '17 23:10 cmosguy

@cmosguy Yes thats the idea. My workaround was to change the startup.sh to use the IP from the host file instead of the hostname. You can get the correct IP from /etc/hosts

KaiNahrgang avatar Oct 18 '17 07:10 KaiNahrgang