docker - 文件存在于 Singularity 容器中,但在执行时不会产生此类文件错误
问题描述
尽管能够在容器中看到文件,但我无法在Singularity -s exec
.
首先,我们将构建映像并调查 Python 脚本的位置fasta_generate_regions.py
:
$ sudo docker pull alice0812ki/freebayes
$ sudo docker run -it --entrypoint /bin/bash alice0812ki/freebayes
root@ae2f1c94be30:/# find . -name "fasta_generate_regions.py"
./usr/local/bin/fasta_generate_regions.py
./usr/local/pkgs/freebayes-1.3.2-py27h49fb759_2/bin/fasta_generate_regions.py
因为我使用的是 HPC,所以我需要使用它Singularity
,所以让我们先为其构建一个图像。
$ sudo singularity build freebayes.sif docker://alice0812ki/freebayes:latest
现在,通过仅运行命令的第一部分(注意:您不需要任何输入文件来解决此问题),您可以看到我们在查找存在No such file or directory
的 Python 脚本时遇到错误:
$ singularity -s exec freebayes.sif freebayes-parallel <(fasta_generate_regions.py )
fasta_generate_regions.py: command not found
usage: /usr/local/bin/freebayes-parallel [regions file] [ncpus] [freebayes arguments]
Run freebayes in parallel over regions listed in regions file, using ncpus processors.
Will merge and sort output, producing a uniform VCF stream on stdout. Flags to freebayes
which would write to e.g. a particular file will obviously cause problms, so caution is
encouraged when using this script.
examples:
Run freebayes in parallel on 100000bp chunks of the ref (fasta_generate_regions.py is also
located in the scripts/ directory in the freebayes distribution). Use 36 threads.
freebayes-parallel <(fasta_generate_regions.py ref.fa.fai 100000) 36 -f ref.fa aln.bam >out.vcf
解决方案
似乎是,对于您要在容器中执行的每个脚本,它都需要在调用之前singularity
调用exec
.
因此它看起来像:
singularity -s exec freebayes.sif freebayes-parallel \
<(singularity -s exec fasta_generate_regions.py ... )
推荐阅读
- c++ - 移动构造函数和右值引用
- angular - Ionic v4 windows平台出现黑屏
- c# - 如何从 C# 程序运行 PowerShell 脚本?
- python - 我需要一些帮助才能让我的 python 脚本正常工作
- python - ImportError:无法导入名称“fitpack”
- r - 我需要在 r 中创建列的未来 7 天值的总和。总和应由具有字符串值的另一列分组
- java - 返回 1 到 100 之间 num 的倍数之和
- google-drive-api - 仅使用 REST 为 Google Drive 服务帐户生成访问令牌
- excel - 引用另一个单元格的 Excel 验证公式
- android - 奥利奥上的下载管理器 pdf