rocker-org / rocker

R configurations for Docker
https://rocker-project.org
GNU General Public License v2.0
1.45k stars 273 forks source link

Question - running studio server and installing packages in linked volume (folder) #441

Closed rkrug closed 3 years ago

rkrug commented 3 years ago

I would like to use the studio rocker image as a studio server. This works, and I can access it. But I would like to have the package library in a linked volume. I know how I can sweep linked volumes (https://github.com/rocker-org/rocker/wiki/Sharing-files-with-host-machine), but what is the /FOLDER/IN/DOCKER in the docker image?

docker run -v /Users/bob/R/library:/FOLDER/IN/DOCKER [...]

Also - is there anything else I have to do, so that this directory will be used?

Thanks.

eddelbuettel commented 3 years ago

(Untested)

/FOLDER/IN/DOCKER is any folder you make accessible to Docker / inside Docker. For example: /opt/R/packages/. You then probably need to (from the outside too) set R_LIBS or R_LIBS_USER to adjust your .libPaths to add /opt/R/packages. You could also try editing /etc/R/* files in the container and re-commit it but the "transient" use of environment variables may be simpler.

rkrug commented 3 years ago

Thanks Dirk - sounds perfect with using the environmental variable. Now I just have to figure out how I can start a docker image on startup of my Mac.