I am trying to make a Docker image that has R and the library "DECIPHER" installed.
According to the website, the package is supposed to be installed with the following commands inside R:
if (!requireNamespace("BiocManager", quietly=TRUE))
install.packages("BiocManager")
BiocManager::install("DECIPHER")
However, I would like to install it in my docker image. To do this, I made the following Dockerfile:
# syntax=docker/dockerfile:1
FROM r-base:latest
RUN R -e "install.packages('BiocManager')"
RUN R -e "BiocManager::install('DECIPHER')"
When I did the following, it doesn't seem like DECIPHER was installed:
% docker build -t test .
% docker run -it --name asdf test bash
/# R
R version 4.1.2 (2021-11-01) -- "Bird Hippie"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DECIPHER)
Error in library(DECIPHER) : there is no package called ‘DECIPHER’
>
I am unsure how to resolve this. I am new to docker and normally install my R packages within the R environment and not via the command line. I appreciate any help you can offer so that I install this package in my docker image.
Edit:
Something was going wrong during the installation. Basically, BiocManager failed to install RCurl, which caused the installation of other dependencies to fail as well. I did not resolve this issue. Instead, I simply copied the one function I needed from the DECIPHER package into my code. This resolved the issue for my purposes, but does not solve the problem I identified here.
Special thanks to @r2evans for helping me to diagnose the problem.