为arm构建镜像以使Docker工作

问题描述 投票:0回答:1

我正在尝试运行使用 Docker 的生物信息学管道(Nextflow - Eager),但由于我有 Mac M1 芯片,它无法工作,并且收到此错误消息:

Command error:
  WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

我知道我应该为手臂构建图像,但我不确定我做得是否正确。 我尝试

vim ~/.nextflow/config
并添加
docker.runOptions = '-u $(id -u):$(id -g) --platform=linux/amd64'
,然后使用以下命令再次运行管道:
nextflow run nf-core/eager -r 2.4.6 -profile test,docker
但我仍然收到此错误:

Execution cancelled -- Finishing pending tasks before exit
Error executing process > 'adapter_removal (JK2782_L1)'
Caused by:
 Process exceeded running time limit (10m)
Command executed:
 mkdir -p output
  
 AdapterRemoval --file1 JK2782_TGGCCGATCAACGA_L008_R1_001.fastq.gz.tengrand.fq.gz --file2 JK2782_TGGCCGATCAACGA_L008_R2_001.fastq.gz.tengrand.fq.gz --basename JK2782_TGGCCGATCAACGA_L008_R1_001.fastq.gz.tengrand.fq_L1.pe --gzip --threads 2 --qualitymax 41 --collapse --trimns --trimqualities --adapter1 AGATCGGAAGAGCACACGTCTGAACTCCAGTCAC --adapter2 AGATCGGAAGAGCGTCGTGTAGGGAAAGAGTGTA --minlength 30 --minquality 20 --minadapteroverlap 1
  
 cat *.collapsed.gz *.collapsed.truncated.gz *.singleton.truncated.gz *.pair1.truncated.gz *.pair2.truncated.gz > output/JK2782_TGGCCGATCAACGA_L008_R1_001.fastq.gz.tengrand.fq_L1.pe.combined.tmp.fq.gz
  
 mv *.settings output/
  
 ## Add R_ and L_ for unmerged reads for DeDup compatibility
 AdapterRemovalFixPrefix -Xmx4g output/JK2782_TGGCCGATCAACGA_L008_R1_001.fastq.gz.tengrand.fq_L1.pe.combined.tmp.fq.gz | pigz -p 1 > output/JK2782_TGGCCGATCAACGA_L008_R1_001.fastq.gz.tengrand.fq_L1.pe.combined.fq.gz
Command exit status:
 -
Command output:
 (empty)
Command error:
 WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
 Trimming paired end reads ...
 Opening FASTQ file 'JK2782_TGGCCGATCAACGA_L008_R1_001.fastq.gz.tengrand.fq.gz', line numbers start at 1
 Opening FASTQ file 'JK2782_TGGCCGATCAACGA_L008_R2_001.fastq.gz.tengrand.fq.gz', line numbers start at 1
  
 Processed a total of 20,000 reads in 1.0s; 19,000 reads per second on average ...
Work dir:
 /Users/valentina/test2/work/11/83eeaec751248909302745eca1e24f
Tip: when you have fixed the problem you can continue the execution adding the option `-resume` to the run command line

我该如何修复它?谢谢

docker arm apple-m1 nextflow
1个回答
0
投票

Mac M1 是 ARM64 处理器,但

nfcore/eager
仅适用于 AMD64。 M1 应该也能够运行 AMD64 映像,这要归功于名为 Rosetta 的模拟器(请参阅此页),但有人说(请参阅此页):

您永远不会满意在 Mac 上的 Docker 中使用任何 amd64 组件 M1。 Docker Desktop(并且只有 Docker Desktop)出了问题 尝试能够运行amd64组件,但是确实不行 一般情况下。

至少您应该验证您是否拥有最新版本的 Docker Desktop 以及 Rosetta 模拟器或安装它; Rosetta 的安装可以通过以下方式完成:

softwareupdate --install-rosetta

如 Docker 文档中所述。请注意,我没有 Mac,所以我无法更具体地讨论这个主题。我也不知道你正在使用的生物信息学工具,所以我无法确认强制使用 AMD64 图像的正确方法是编辑~/.nextflow/config

,但似乎答案是否定的,因为错误消息仍然显示“否”已请求特定平台”。

由于您不是直接运行 Docker,而是通过另一个名为

nextflow

 的工具运行,您可以尝试使用本页
建议的解决方案: export DOCKER_DEFAULT_PLATFORM=linux/amd64

另一种解决方案是为 ARM64 重建映像,但这不是一项简单的任务。我成功重建 AMD64 映像,但 ARM64 映像出现错误:似乎未满足某些先决条件,但如果不知道这个生物信息学工具,我就无法做更多事情。

© www.soinside.com 2019 - 2024. All rights reserved.