如何使用Nohup使Docker命令在后台运行

时间:2020-08-26 15:47:06

标签: linux docker centos

我正在这样运行docker命令:

docker exec -t -i 44a1459f4468 cloudgene run imputationserver@1.4.1 --files /chrX_impute/ALL.chrX.Non.Pseudo.Auto.phase3_v5.shapeit2_mvncall_integrated.noSingleton.genotypes.vcf.gz --refpanel apps@1000g-phase-3-v5@2.0.0 --conf /etc/hadoop/conf --population mixed --mode qconly --output /chrX_impute/ALL.chrX.Non >  ALL.chrX.Non.qc.log 2>&1

使用从Redirecting output of nohup in docker not working获得的建议并重定向

但是,当我运行此命令时,它不会在后台运行。

https://unix.stackexchange.com/questions/268284/nohup-doesnt-work-as-expected-in-docker-script听起来像添加-t一样使它像shell命令一样运行,但这仅适用于docker run

如何使此docker命令与nohup一起运行?

1 个答案:

答案 0 :(得分:1)

从docker exec文档页面https://docs.docker.com/engine/reference/commandline/exec/

--interactive , -i      Keep STDIN open even if not attached
--tty , -t              Allocate a pseudo-TTY

我想同时删除-i-t标志就足够了

相关问题