linux - 如何使用 nohup 让 docker 命令在后台运行
问题描述
我正在运行一个 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命令一样运行,但这只有效与码头工人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
标志可能就足够了
推荐阅读
- java - spring cloud config客户端立即启动和停止
- ios - Swift 5:如何读取 plist 文件中的变量?
- php - 表单没有发送任何值
- java - 从类的“数组版本”到Java中具有反射的类
- c# - AES 解密在 python 中有效,但在 .NET 中无效
- php - 我想通过单击超链接从 db 按名称而不是按 id 获取数据
- android - 如何设置TextInputLayout的轮廓框浮动提示背景颜色
- typescript - 使用“对象名称中的键”时设置键类型
- php - Laravel从帖子模型belongsTo关系中获取用户角色
- listview - 在 Nativescript-vue 中更改 ListView 中所选项目的背景颜色