linux - 如何使用 nohup 让 docker 命令在后台运行

标签 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 一起运行?

最佳答案

来自 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标志可能就足够了

关于linux - 如何使用 nohup 让 docker 命令在后台运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63601177/

相关文章:

linux - 在 CASE 语句后继续函数

linux - 我们可以在多线程进程的 strace 输出中获取线程的线程 ID 吗?

linux - 如何压缩文件夹或目录及其所有文件(除了删除某些文件夹中的文件)?

mongodb - Orion Context Broker 和 Docker - 来自服务器的空回复

java - 如何通过 docker-compose 可靠地使用本地 Maven 镜像代理?

laravel - 无法使用 3 个可能的身份验证器在用户名\"yourmail@gmail.com\"的 SMTP 服务器上进行身份验证 Authenticator LOGIN 返回了预期的响应

regex - 如何使用 sed 命令删除一行中除前三个字符以外的所有字符?

Docker 错误 : Cannot create container for service, 没有这样的文件或目录

python - 如何安装libpython2.7.so

centos - 我在使用该功能时有一个问题。 `` `yum --仅下载 ```