ramiro
ramiro

Reputation: 103

Program not running using singularity but works in docker

I have the following Docker recipe which works fine with Docker:

FROM mambaorg/micromamba:1-noble
LABEL maintainer="[email protected]"
RUN micromamba install -y -n base -c bioconda -c conda-forge fastQC
RUN micromamba clean --all --yes
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/conda/bin

If I build it and run it with Docker it works fine

docker build -t test .
docker tag test:latest rbarrant/test:0.1
docker push rbarrant/test:0.1

docker run rbarrant/test:0.1 fastqc --help

But with singularity it complains:

singularity exec docker://rbarrant/test:0.1 fastqc

INFO: Using cached SIF image Can't locate FindBin.pm in @INC (you may need to install the FindBin module) (@INC entries checked: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.38.2 /usr/local/share/perl/5.38.2 /usr/lib/x86_64-linux-gnu/perl5/5.38 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.38 /usr/share/perl/5.38 /usr/local/lib/site_perl) at /opt/conda/bin/fastqc line 4. BEGIN failed--compilation aborted at /opt/conda/bin/fastqc line 4.

What am I missing?

Upvotes: 1

Views: 37

Answers (2)

ramiro
ramiro

Reputation: 103

I got it, just need to add PERL5LIB as an environment variable.

ENV PERL5LIB=/opt/conda/lib/perl5/core_perl/

Again, this is not needed for Docker, but it is for singularity. Hence the recipe would be:

FROM mambaorg/micromamba:1-noble
LABEL maintainer="[email protected]"
RUN micromamba install -y -n base -c bioconda -c conda-forge fastQC
ENV PERL5LIB=/opt/conda/lib/perl5/core_perl/
RUN micromamba clean --all --yes
ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/conda/bin

Upvotes: 1

poisoned_monkey
poisoned_monkey

Reputation: 434

Try to add the line below to your Dockerfile, it will install perl:

RUN micromamba install -y -n base -c conda-forge perl

Upvotes: 0

Related Questions