Connect to Oracle XE running on Docker

I am trying to connect to Oracle XE, which runs docker on my Mac.

docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11g

$ docker ps
CONTAINER ID        IMAGE                     COMMAND                  CREATED             STATUS              PORTS                                                      NAMES
105d84763b6c        wnameless/oracle-xe-11g   "/bin/sh -c '/usr/sbi"   4 minutes ago       Up 4 minutes        8080/tcp, 0.0.0.0:49160->22/tcp, 0.0.0.0:49161->1521/tcp   hopeful_pasteur

When I contact him through SQL Developer with the following credentials:

hostname: localhost
port: 49161
sid: xe
username: system
password: oracle

I get an error message:

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

Docker Log shows:

Starting Oracle Net Listener.
Starting Oracle Database 11g Express Edition instance.
+4
source share
1 answer

I assume that you are using Windows or OSX, so you should not use localhost for the host name, instead you should use your ip address of the docker machine ie

docker-machine ip default
>172.16.34.132
+4
source

All Articles