错误写法:
cli.execute(‘9b2606a50304‘,‘echo "bibo">/tmp/1.txt‘)
争取写法:
cli.execute(‘9b2606a50304‘,‘bash -c "echo \‘yuanyuan\‘ > /tmp/2.txt"‘)
参考:https://bugzilla.redhat.com/show_bug.cgi?id=1146821
docker-py execute echo无效
原文:http://www.cnblogs.com/biboxie/p/4233412.html