【问题标题】:How to get docker commands to run in the background with nohup如何使用 nohup 让 docker 命令在后台运行
【发布时间】:2020-12-15 11:06:51
【问题描述】:

我正在运行一个 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 运行?

【问题讨论】:

    标签: linux docker centos


    【解决方案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 标志可能就足够了

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-03-15
      • 2022-01-16
      • 1970-01-01
      • 2011-04-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多