Is that wrong to write "localhost" into hostname box of SqlDeveloper’s new connection form while you’re working with Docker?

I’m trying to connect my Oracle-DB container to SqlDeveloper and I’m getting this common error.

Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection

I wanted to check host or port info but I don’t know how to reach tnsnames.ora file of a Docker container.

On the other hand, my docker- sqlplus connection is working very well on the command prompt.

└─$ docker exec -it Oracle-DB bash -c "source /home/oracle/.bashrc; sqlplus /nolog"

SQL*Plus: Release 12.2.0.1.0 Production on Fri Mar 5 11:30:23 2021

Copyright (c) 1982, 2016, Oracle.  All rights reserved.

SQL> connect aysgldb as sysdba;
Enter password:
Connected.
SQL>

What could I be doing wrong?

here is the screenshot

Thanks

Source: Docker Questions

LEAVE A COMMENT