Docker python sdk question | oracle database connection

  • From: kunwar singh <krishsingh.111@xxxxxxxxx>
  • To: ORACLE-L <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 30 Mar 2020 10:07:52 -0400

Hi Listers,
I am trying to convert my call to oracle database in docker with python
docker sdk

*Docker cli command *:docker exec 4b3e6b612345
/u01/app/oracle/product/12.0.0/dbhome_1/bin/sqlplus testuser/testpwd@orcl
@run.sql

*Python code:*

import docker
client = docker.from_env()

client.exec_run('4b3e6b612345',command='/u01/app/oracle/product/12.0.0/dbhome_1/bin/sqlplus
testuser/testpwd@orcl @run.sql')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/docker/client.py", line 205,
in __getattr__
    raise AttributeError(' '.join(s))
AttributeError: 'DockerClient' object has no attribute 'exec_run'

OEL 7.7 is the OS

Can you please suggest me if i am doing something wrong with the syntax.
Still  a newbie in python & docker , apologies in advance :)

-- 
Cheers,
Kunwar

Other related posts: