Network Adapter error when accessing a web app from my desktop on a container in the same network as the oracle database container

Hello,

I’m running the latest oracle container and a tomcat container tomcat:9.0.22-jdk8 on my own network and I used the following commands:

docker network create mynetwork

docker run -dit -p 8080:8080 -e JPDA_ADDRESS=8000 -p 8000:8000 -e JAVA_OPTS=’-Dconfig.file=/usr/local/tomcat/temp/config.properties -Xmx512m’ --name rcmc rcm-container:0.1 catalina.sh jpda run

docker run -dit -p 1521:1521 --name rcmdb rcmoracledatabase:0.1

docker network connect mynetwork rcmc
docker network connect mynetwork rcmdb

I can login from my desktop to the database container without any issues using these tnsnames.ora entries:

ORCLCDB=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rcmdb)(PORT=1521))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCLCDB.localdomain)))
ORCLPDB1=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rcmdb)(PORT=1521))
(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ORCLPDB1.localdomain)))

When I try to login from my webapp at http://localhost:8080/ I get a server 500 error with the following exceptions:

oracle.net.ns.NetException: The Network Adapter could not establish the connection
java.sql.SQLRecoverableException: IO Error: The Network Adapter could not establish the connection

I’ve tried the following JDBC connection strings, but I can’t seem to connect to the oracle container.

jdbc:oracle:thin:@rcmdb:1521:ORCLCDB
jdbc:oracle:thin:@rcmdb:1521:ORCLCDB.localdomain
jdbc:oracle:thin:@0.0.0.0:1521:ORCLCDB
jdbc:oracle:thin:@0.0.0.0:1521:ORCLCDB.localdomain

These commands work on my co-worker’s laptop, but he’s running docker toolbox on his desktop

My docker info
Kernel Version: 4.9.184-linuxkit
Operating System: Docker Desktop
OSType: linux

His docker info
Kernel Version: 4.14.116-boot2docker
Operating System: Boot2Docker 18.09.6 (TCL 8.2.1)
OSType: linux

Am I missing something? Are there any settings that I need to look into?

Thanks in advance for any info.

In reading this documentation, the following worked

jdbc:oracle:thin:@host.docker.internal:1521:ORCLCDB