Closed GMFranceschini closed 1 year ago
I think it's definitely writing a Dockerfile.
Also, I'm not sure if I can do it around the use of sudo.
pak
has the ability to automatically install dependencies, but the sudo command is still required.
Thank you for your answer. My current attempt is to convert the Dockerfile into a Singularity definition using spython
and then provide an additional script to install the required libraries on top of the image. The only inconvenience is that this should be done each time a new library is added, but I hope this won't be so frequent
(For completeness: If you start from the rocker/r2u container everything is handled by apt
i.e. when you add igraph
even via the standard install.packages("igraph")
adds everything as needed by apt
. But that isn't the versioned stack so you may have a preference for it. Otherwise see here about r2u.)
Wow @eddelbuettel , this sounds exactly what I was looking for! Let me understand if I got this correctly: for my use case, I will build upon this Dockerfile (https://github.com/rocker-org/r2u/blob/master/jammy/Dockerfile) to add Rstudio/Rserver, and then my container will have capabilities to install all R packages including the required system libraries. If I got this right, I believe this might be an optimal solution.
Yes! I have been using this left right and center for CI, debugging, deployment, ... and it is great. (I also just built a debugging variant for r-devel, not yet pushed.) And it just works -- we shipped north of 10 million binary packages in the 1 1/2 years it has been up.
One thing I have not done for lack of time / lack of someone pushing is to maybe build on top and 'simply' add rstudio desktop and/or server. It should be rather straightforward. (I even keep a PPA for my use with Ubuntu .deb files for rstudio server and desktop but that uses nightlies which one may not want here.) I'd be happy to bounce that off you especially if you can lead the local experimentation. Do you want to open a ticket at the r2u repo?
Absolutely, I am looking forward to experimenting and getting this working with RStudio as well, I think it could benefit many. As a disclaimer, I am not very knowledgeable about containers, but I am very happy to update you in case of success! I'll close this issue and we can move into the r2u repo. I'll post there over the next few days, hopefully with good news!
Container image name
rocker/tidyverse:4.2.1
Container image digest
No response
What operating system related to this question?
Linux
System information
Singularity 4.0.1 Ubuntu 22.04
Question
Good evening, I am looking for advice on how to manage additional system dependencies once I have built my container. I am currently binding my R library from the local machine to the container, but some packages require additional system libraries (like say iGraph requiring libglpk-dev). I don't now all the packages I will use in advance, so I would like a workaround to add them.
How would you add such a library to the container, possibly without rebuilding it or using sudo? I expect this to happen from time to time. Also, as I am using singularity, it is not straight-forward to edit the Dockerfile, and I would probably need to go through a Docker image and then convert it to singularity. Any advice is appreciated, thank you