The output of the process is not accessible

Hi, I’m completely new to Nextflow and I would need some help please:

  1. I created a docker container using the following Dockerfile :
FROM python:3.10

LABEL image.author.name "..."
LABEL image.author.email "..."

# Install required packages including Bash and ps
RUN apt-get update && \
    apt-get install -y bash procps && \
    apt-get clean

# Set Bash as the default shell
SHELL ["/bin/bash", "-c"]

# Set working directory
WORKDIR /app

# Copy the requirements.txt file into the container
COPY requirements.txt .

# Install required packages using pip
RUN pip install --no-cache-dir -r requirements.txt

# Set Bash as the container entrypoint
ENTRYPOINT [ "/bin/bash", "-l", "-c" ]

with “requirements.txt” a list of python packages.

I build my container using
docker build -t myimage .

Using docker images I can see that it has been created, and using docker run -i myimage "echo 'hello'" I see that it works fine.

  1. in the nextflow.config I have:
process.container = 'myimage' 
docker.enabled = true
  1. my workflow reads as
process sayHello {
    output:
    stdout

    """
    echo Hello world!
    """
}

workflow {
    sayHello | view { "I say... $it" }
}

  1. the output reads as I say... => it seems that the stdout output is not accessible.

Similarly, I tried to create .csv file in the process using python code and they are not saved anywhere.

Would anyone know what I’m missing here? I’m working on macOS. As I don’t get any error messages and that I’m completely new to Nextflow, i’m a bit lost…

Thank you so much for your help!

That works fine on my machine. One thing I would recommend is to not use ENTRTYPOINT, it’s designed for making a Docker file an executable. In general, I would avoid it unless you really need it.

Try using process.container = 'docker.io/debian:trixie-slim' which will pull a public container which definitely works.

Hi @Adam_Talbot, thank you very much! you are right, if I remove the entrypoint from my dockerfile it works! However, the reason I added it is because of the container documentation, which says " Also, Bash should be available on the path /bin/bash and it should be the container entrypoint." Shouldn’t I use the entrypoint in the dockerfile for this? Thanks a lot for the help!

This really means ‘don’t set ENTRYPOINT=python mytool.py’. This is something a number of Docker images do to make them a container as software, but for Nextflow they just get in the way.

Nextflow will run the container with a command that is essentially docker run containerName /bin/bash -ue ${process.script}, so in general, you can leave ENTRYPOINT alone and Nextflow should work fine.

Thank you very much for the clarification!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.