title: Oracle Database docker linux VM - Laptop connection
body: <p>I have an Oracle database running in a Linux VM. The way i started the docker is using the following command</p>
  
  <pre><code>sudo docker run -d --name my_db --net oac_net -p 1521:1521 -P --shm-size=4G bi.docker.oraclecorp.com/database/enterprise:12.1.0.2
  </code></pre>
  
  <p>This is running inside a Linux VM. </p>
  
  <pre><code>[oracle@07f1d37f71c9 /]$ hostname -i
  172.18.0.2
  </code></pre>
  
  <p>I would like to connect to this database docker from my laptop. The TNS entry in my laptop is like the following</p>
  
  <pre><code>odidocker =   (DESCRIPTION =     (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.0.2)(PORT = 1521))     
  (CONNECT_DATA =       (SERVER = DEDICATED)       (SERVICE_NAME = ORCL.localdomain)     )   )
  PDBORCL=
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.0.2)(PORT = 1521))
    (CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = pdborcl.localdomain)
    ))
  </code></pre>
  
  <p>Trying to connect using the following command</p>
  
  <pre><code>sqlplus system/welcome1@odidocker 
  </code></pre>
  
  <p>the error we are getting is the following</p>
  
  <pre><code>ORA-12154: TNS:could not resolve the connect identifier specified
  </code></pre>
  
  <p>What is the mistake i am making. Could someone please help.</p>
  
  <p>Thanks</p>
  
  <p>Bala</p>