Hello. I want to understand how can I use a CLI to...
# help
a
Hello. I want to understand how can I use a CLI tool within my docker container, which is built/exists locally - as part of a module.
n
An nf-core module, or your own local module?
a
my own local module
n
Ok, so you have a local container that you would like to essentially execute your module in?
a
yes. I have a local container. In that container I have built a binary that I want to execute as part of the pipeline
n
it should essentially be
container path/to/your/container
in the module directives
I never tried putting a local container in there
you can also open a free account on quay.io and build your container there if you do not have some container registry to put them in
a
So I have tried:
Copy code
process DENSITY_FITNESS {
    container '<file://Users/xxxxx/docker/images/density-fitness:latest>'
this:
Copy code
process DENSITY_FITNESS {
    container 'density-fitness'
Without the
file:///
as well. and it doesn't seem to work
n
without file it probably tries to pull from somewhere, yeah
a
Right now, I can't really push my container anywhere public, I would like it to be local.
n
I see. Are you using docker? I guess you are. As far as I can tell, nextflow essentially stuffs whatever comes after
container
into
docker run
a
Yes. I am using docker. I can run the command on my own system currently with a:
Copy code
docker run -v $(pwd)/test_files:/data density-fitness \
  --hklin mtz-file \
  --xyzin cif_file \
--output /data/to/output
I just want to translate that functionality to a module
n
when you just do
container 'density-fitness'
does it produce some kind of error?
alternatively, what does.
.command.run
in the task workdir look like?
a
Here is the error:
Copy code
N E X T F L O W   ~  version 25.10.4

Launching `<http://main.nf|main.nf>` [fabulous_becquerel] DSL2 - revision: 5fd6ec8498

executor >  local (2)
[6c/eff270] process > PDBE_STANDARDIZECIF:STANDARDIZECIF:STANDARDCIF ($cif)  [100%] 1 of 1 ✔
[83/016c9a] process > PDBE_STANDARDIZECIF:STANDARDIZECIF:DENSITY_FITNESS (1) [  0%] 0 of 1 ✘
Execution cancelled -- Finishing pending tasks before exit
WARN: Task runtime metrics are not reported when using macOS without a container engine
ERROR ~ Error executing process > 'PDBE_STANDARDIZECIF:STANDARDIZECIF:DENSITY_FITNESS (1)'

Caused by:
  Process `PDBE_STANDARDIZECIF:STANDARDIZECIF:DENSITY_FITNESS (1)` terminated with an error exit status (127)


Command executed:

  density-fitness \
      --hklin 3d12_map.mtz \
      --xyzin something.cif \
      --output myfile

Command exit status:
  127

Command output:
  (empty)

Command error:
  .command.sh: line 3: density-fitness: command not found

Work dir:
  /Users/ahsan/PDBe-Pipelines/StandardCif/work/83/016c9ac52c87246f3c2ae3fc756d8a

Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`

 -- Check '.nextflow.log' file for details