我正在尝试在已经运行的容器上使用 docker-py 运行 shell 命令,但出现错误:
exec: "export": executable file not found in $PATH
这是我编写脚本的方式:
exe = client.exec_create(container=my_container, cmd='export MYENV=1')
res = client.exec_start(exec_id=exe)
所以我的问题是如何使用 docker-py 运行 shell 命令(在容器内)?