I created a docker container with python and several packages which I put in my module. But then the process can’t locate the files the way it’s supposed to:
python transfer_data.py ... doesn’t work because python will look for transfer_data.py in the current directory (where your process inputs are staged).
The ${source_directory} likely doesn’t work because it’s probably a reference to something not in the container image - when executing containers, nextflow only binds in what is necessary (and the nextflow way is to accept it as a path - then nextflow will stage it in the work directory).
transfer_data.py is in the bin directory, i have used that all the time and I can run this successfully in the conda environment. Definitely the ${source_directory} is not in the container image. All that said, you make some good points about the binding. Mine is a very particular use case so I will ask about that separately.
For a script to be found in the bin directory you can’t call it using the interpreter.
e.g., python transfer_data.py does not check the PATH variable for the script. Only the current directory.
But transfer_data.py without the interpreter before (python) will look in the PATH, which the bin/ folder is included in.