4

I pulled image

docker pull store/oracle/database-enterprise:12.2.0.1 from here https://hub.docker.com/u/brekhinaleks/content/sub-6f22957e-9628-4ac6-a935-1c0cab2f648e

And execute

docker run -d -it --name ETL store/oracle/database-enterprise:12.2.0.1

➜  ~ docker run -d -it --name ETL store/oracle/database- 
enterprise:12.2.0.1
aaca9926e1653027c24610cdde97f542f3ca2551f224942e84c80daea355642b
➜  ~ docker logs ETL
Setup Oracle Database
Oracle Database 12.2.0.1 Setup
Tue Jun 25 15:35:35 UTC 2019

Check parameters ......
log file is : /home/oracle/setup/log/paramChk.log
paramChk.sh is done at 0 sec

untar DB bits ......
log file is : /home/oracle/setup/log/untarDB.log

But i can't connect to DB enter image description here

1
  • don't you need to tell docker to port forward traffic on 1521? Commented Jun 25, 2019 at 20:26

4 Answers 4

4

If you got this message : Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection just follow this step :

before starting make sure your are ruining the docker image using port forwarding :

docker run -d -p 1521:1521 --name Oracle store/oracle/database-enterprise:12.2.0.1

->1 :

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

-> 2 :

connect sys/Oradoc_db1@ORCLCDB as sysdba 

-> 3 give permission to sys user or any user you want to use on your Sql developer :

grant all privileges to sys ;

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

3

None of the above method worked for me. I was able to connect by using the actual ip of the container.

I run the container as docker run -it -p 1512:1512 store/oracle/database-enterprise:12.2.0.1-slim

Then I would get a bash console to play round

docker exec -it CONTAINER_ID bash

Inside the container I look up the ip

$ ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
46: eth0@if47: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 172.17.0.2/16 brd 172.17.255.255 scope global eth0

Finally I use the address of the non loopback interface to connect using SQL Developer

4 Comments

YES! changing localhost to 172.17.0.2 actually solved it for me!
Thanks! This is what I'm looking for. I wish I saw this half day ago.
What if my oracle container is on remote, and I want to access with my local machine?
@hanshih you could try with some sort of forwarding, maybe socat?
1

add docker port oracle-db 1521/tcp this command return port and apply this enter image description here

Comments

0

You're just missing the "-P" parameter in your docker run command, which tells Docker to assign a public port. Try this instead:

docker run -d -it --name ETL -P store/oracle/database-enterprise:12.2.0.1

Then run this to find out the local port assignment:

docker port ETL

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.