不进入容器内,通过容器ID执行某个容器的某条命令:

执行python脚本
docker exec -it 3f196c0748c0 python /root/my_test_python/helloworld.py

执行R脚本
docker exec -it 0f48d1db536e Rscript /root/R/test.R

-c 参数,后面的字符串就是容器内需要执行的命令
docker exec -it 1282d4513328 bash -c ‘cd /root/makeflow && makeflow test.mf’

报错:bash: makeflow: command not found
原因:没有建立软连接,可以采用绝对路径
docker exec -it 1282d4513328 bash -c ‘/root/cctools/bin/makeflow /root/makeflow/test.mf’

通过容器名称执行命令:

docker exec -it pythontest python /root/python/test.py
docker exec -it rtest Rscript /root/R/test.R
docker exec -it newcctools705 bash -c ‘/home/pipeline/test/test_makeflow/test.mf’
//docker exec -it newcctools705 makeflow -T local ‘/home/pipeline/test/test_makeflow/test.mf’