Search code examples
windowsoracle-databasedockerjbossconnection

Windows - jboss on docker, connection refused to local oracle database


I have Jboss running in a docker container. On jboss I have defined a connection to the xa-datasource database as the ip address of my computer and not localhost because I work in Windows 10. Despite the correct ip and port to the database (oracle) I keep getting the connection refused error. I run jboss with the command

docker run -d -p 8080:8080 -p 9990:9990 myjboss

Can anyone help me, or do I need any additional settings in my docker. I will add that I also test alpine and in the container (exec) I can ping my ip address.

Thanks a lot for all the answers. I would like to add that I tested all other solutions contained in similar questions, but unfortunately I did not get the expected results.


Solution

  • I solved this problem by using not ip/localhost but host.docker.internal as described here -> https://docs.docker.com/docker-for-windows/networking/