展开

使用docker环境

最后发布时间 : 2023-11-18 10:43:57 浏览量 :

学习资料

-with-docker

process.container = 'quay.io/nextflow/bash'
docker.enabled = true

在配置文件写入docker.enabled = true或者使用参数-with-docker

#!/usr/bin/env nextflow
nextflow.enable.dsl=2 

process sayHello {
  input: 
    val x
  output:
    stdout
  script:
    """
    echo '$x world!'
    """
}
println params.input
workflow {
  Channel.of('Bonjour', 'Ciao', 'Hello', 'Hola') | sayHello | view
}

使用容器的.command.run

nxf_launch() {
    docker run -i --cpu-shares 1024 -v /home/wy/workspace/nf-hello/work/b6/fab3531ef8670189fa719a152ee958:/home/wy/workspace/nf-hello/work/b6/fab3531ef8670189fa719a152ee958 -w "$PWD" --name $NXF_BOXID quay.io/nextflow/bash /bin/bash -ue /home/wy/workspace/nf-hello/work/b6/fab3531ef8670189fa719a152ee958/.command.sh
}

不使用容器的.command.run

nxf_launch() {
    /bin/bash -ue /home/wy/workspace/nf-hello/work/00/2fbdffc2e9e6936a80918d8d84dabc/.command.sh
}

使用多个容器

process {
    withName:foo {
        container = 'image_name_1'
    }
    withName:bar {
        container = 'image_name_2'
    }
}
docker {
    enabled = true
}