Has anyone managed to install ggpubr in the Docker container rocker/r-base? Or are there any containers with ggpubr already installed?

I am new to Docker, but I am trying to install ggpubr and ggplot2 in rocker/r-base container and I cannot install ggpubr. I believe it may be an issue with the dependencies possibly although I have checked the package dependencies and installed them as well.

This is my Dockerfile

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libcurl4-openssl-dev \
    libssl-dev \
    libxml2-dev \
    libgit2-dev \
    libcairo2-dev \
    build-essential \
    libxt-dev \
    libgsl-dev \
    libharfbuzz-dev \
    libfribidi-dev \
    libfreetype6-dev \
    libpng-dev \
    libtiff5-dev \
    libjpeg-dev \
    libfontconfig1-dev \
    && rm -rf /var/lib/apt/lists/*

# Install R dependencies
RUN R -e "install.packages('remotes', repos="https://cloud.r-project.org/")"

# Install devtools using remotes
RUN R -e "remotes::install_cran('devtools')"

# **Create a valid R package inside the container**
RUN R -e "usethis::create_package('/usr/local/src/rplotres', open = FALSE)"

# Install ggplot2 separately
RUN R -e "install.packages('ggplot2', repos="https://cloud.r-project.org/", dependencies = TRUE)"

#Install dependencies for ggpubr

RUN R -e "install.packages(c('ggrepel', 'grid', 'ggsci', 'stats', 'utils', 'tidyr', 'purr', 'dplyr','cowplot', 'ggsignif','scales', 'gridExtra', 'glue', 'polynom', 'rlang', 'rstatix', 'tibble', 'magrittr', 'grDevices', 'knitr', 'RColorBrewer', 'gtable', 'testthat'), repos="https://cloud.r-project.org/")"

###Check Development Tools: lines to ensure everything needed is there to building packages

RUN apt-get update && apt-get install -y build-essential

# Install ggpubr separately

RUN R -e "install.packages('ggpubr', repos="https://cloud.r-project.org/", dependencies = TRUE)"

# Install the R package
RUN R -e "devtools::install('/usr/local/src/rplotres')"

# Set the command to run R by default
CMD ["R"]

I am not sure how to proceed from here. Everytime I convert the docker container to a sif image and use it with singularity interactively, ggpubr is not there, although ggplot2 is.

Read more here: Source link