我正在开发一个与docker容器交互的应用程序。
我想以 docker exec name_of_container命令方式执行此命令:
command= "/usr/bin/balance -b "+ ip_address + " 5001 " + servers_list
我们的想法是执行 echo 命令 &gt;&gt; / etc / supervisor / conf.d / supervisord.conf` < / p>
我尝试如下:
p=subprocess.Popen(['docker','exec','supervisor','echo','command'],
stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
但它不起作用。
这是错误代码:
exec: "'/usr/bin/balance -b 195.154.12.1 5001 192.186.13.1' >> /etc/supervisor/conf.d/supervisord.conf": stat '/usr/bin/balance -b 195.154.12.1 5001 192.186.13.1' >> /etc/supervisor/conf.d/supervisord.conf: no such file or directory