Bioconductor / bioc_docker

[DEPRECATED] Docker containers for Bioconductor
https://github.com/bioconductor/bioconductor_docker
Artistic License 2.0
49 stars 27 forks source link

Failed attempt to run docker for deseq2 #96

Closed claudiadast closed 4 years ago

claudiadast commented 4 years ago

I'm trying to install Bioconductor's DESeq2 via a docker container, and based on a Biostars suggestion, I went with the following Dockerfile setup:

Dockerfile

FROM bioconductor/release_base2

# Helps clean up Docker images
RUN rm -rf /var/lib/apt/lists/*

ADD setup.R /tmp/

# invalidates cache every 24 hours
ADD http://master.bioconductor.org/todays-date /tmp/

RUN R -f /tmp/setup.R

setup.R

pkgs <- c(
    "IRanges",
    "GenomicRanges",
    "ggplot2",
    "dplyr",
    "optparse",
    "SummarizedExperiment",
    "S4Vectors"
    )

ap.db <- available.packages(contrib.url(BiocManager::repositories()))
ap <- rownames(ap.db)
fnd <- pkgs %in% ap
pkgs_to_install <- pkgs[fnd]

ok <- BiocManager::install(pkgs_to_install, update=FALSE, ask=FALSE) %in% rownames(installed.packages())

if (!all(fnd))
    message("Packages not found in a valid repository (skipped):\n  ",
            paste(pkgs[!fnd], collapse="  \n  "))
if (!all(ok))
    stop("Failed to install:\n  ",
         paste(pkgs_to_install[!ok], collapse="  \n  "))

suppressWarnings(BiocManager::install(update=TRUE, ask=FALSE))

When I try to run this container interactively though, I get this response:

sudo docker run -v /home/ec2-user/data/:/data -it 096401932500.dkr.ecr.us-west-2.amazonaws.com/deseq2:dev
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] add: executing... 
Nothing additional to add
[cont-init.d] add: exited 0.
[cont-init.d] userconf: executing... 

ERROR: You must set a unique PASSWORD (not 'rstudio') first! e.g. run with:
docker run -e PASSWORD=<YOUR_PASS> -p 8787:8787 rocker/rstudio

Is there a better approach? Also, I want to be able to install python packages within the dockerfile (as I will be running this container on a python-based pipeline) - how can I properly conduct a multi-stage build to do so? I tried doing the following for this, but then my invoked python script run_deseq2.py responded with: /bin/sh: 1: Rscript: not found:

FROM bioconductor/release_base2

ADD src/setup.R /
RUN Rscript /setup.R 

ENV PATH=/usr/local/bin/:$PATH

FROM ubuntu:19.04 

ENV DEBIAN_FRONTEND=noninteractive  

WORKDIR / 

RUN apt-get update && \ 
    apt-get install -y \ 
        python-dev \ 
        python-pip \ 
        wget 

RUN pip install awscli boto3

COPY src/run_deseq2.py /
COPY src/s3_utils.py /
COPY src/job_utils.py /
COPY src/deseq2.R /
COPY src/ModelLoxTag.R /

ENV PATH=$PATH:~/.local/bin/ 
ENV R_THREADS=30 

# Run docker, starting with run script
ENTRYPOINT ["python", "/run_deseq2.py"]
lshep commented 4 years ago

See the docker help files http://bioconductor.org/help/docker/#running That explains this ERROR is expected and you should set the password to whatever you like (just not rstudio).

It should be noted - These docker files are going to be deprecated shortly to newer better maintained dockers with system dependencies that will allow most Bioconductor packages to be installed. There is better documentation, including modifying image help on that page https://github.com/Bioconductor/bioconductor_docker#modify . We hope to have this new docker images up within the next 2 weeks.