Pratheesh
Pratheesh

Reputation: 635

which port Do i need to open in Perl container for connecting oracle db container

I am running oracle db in a container with port 1521 exposed.I have another perl container. This is what docker ps shows:

CONTAINER ID   NAME        IMAGE             COMMAND                  CREATED             STATUS                    PORTS
bb8686d87c66    perl      perl:5.16         "/usr/bin/supervisor…"   5 minutes ago       Up 5 minutes  
9e37dff4c19e    oracle    oracle:12.2.0.1   "/bin/sh -c 'exec $O…"   41 hours ago        Up 41 hours (healthy)   0.0.0.0:1521->1521/tcp , 5500/tcp   oracle        

I am able to ping from perl container to oracle container. But I can't do the same from oracle to perl. I am not exposing ports in perl image. Do I need to expose any port for this ??

I have a link.conf file for perl conatiner which connect oracle db with perl

 LINKS=' --link oracle:oracle'

Finally I want to use a perl script in perl container to connect to the schema. Can I do it with my present configurations?

Upvotes: 2

Views: 154

Answers (1)

Gorav Singal
Gorav Singal

Reputation: 538

If I understand your problem. You have an Oracle instance exposed to some port. You have a perl code, and want to access Oracle.

You dont need to expose any port on perl container (unless it is exposing any service which you want to access outside this container). If you just want to talk to oracle container, there is no need to expose any port on it.

In your perl container, you just need to prepare your db-connection string. As you are using LINKS strategy, you should be able to connect to it, by using name: "oracle" as hostname.

Upvotes: 2

Related Questions