From 1fb029985104ea8a6650861813d957597eea6b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patricie=20Skal=C3=A1kov=C3=A1?= <158295213+Patricie34@users.noreply.github.com> Date: Thu, 1 Aug 2024 12:56:58 +0200 Subject: [PATCH] Update Dockerfile --- rdocker/Dockerfile | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/rdocker/Dockerfile b/rdocker/Dockerfile index 43a69bf..21a1778 100644 --- a/rdocker/Dockerfile +++ b/rdocker/Dockerfile @@ -1,33 +1,23 @@ -# Use the official Ubuntu image as the base -FROM ubuntu:20.04 +# Use the rocker/r-ver base image for R version 4.4.0 +FROM rocker/r-ver:4.4.0 -# Install system dependencies -RUN apt-get update && apt-get install -y \ +# Install system dependencies for the packages +RUN apt-get update && \ + apt-get install -y \ libcurl4-openssl-dev \ - libxml2-dev \ libssl-dev \ - libxt-dev \ - liblzma-dev \ - zlib1g-dev \ - libgmp-dev \ - libgit2-dev \ - gfortran \ - software-properties-common \ - && rm -rf /var/lib/apt/lists/* - -# Add CRAN repository and install R base version 4.4.0 -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E084DAB9 \ - && add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' \ - && apt-get update \ - && apt-get install -y --no-install-recommends r-base=4.4.0-1.2004.0 \ + libxml2-dev \ + && apt-get clean \ && rm -rf /var/lib/apt/lists/* -# Install R packages from CRAN +# Install the required CRAN packages RUN R -e "install.packages(c('ggplot2', 'scales', 'gtable', 'grid'), repos='http://cran.rstudio.com/')" -# Install Bioconductor and DNAcopy package -RUN R -e "install.packages('BiocManager', repos='http://cran.rstudio.com/')" \ - && R -e "BiocManager::install('DNAcopy', update = TRUE, ask = FALSE)" +# Install Bioconductor packages +RUN R -e "if (!requireNamespace('BiocManager', quietly = TRUE)) install.packages('BiocManager'); \ + BiocManager::install(version = '3.19'); \ + BiocManager::install('DNAcopy')" + +# Set the working directory +WORKDIR /home/rstudio -# Set the working directory (optional) -WORKDIR /app