-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libpath to put the custom lib folder in the front #66
Comments
Saw your tweet. These are two distinct issues. You are using To change |
Thanks for your answer. sudo docker run \
-v /home/R/host-site-library:/usr/local/lib/R/host-site-library \
-e R_LIBS_USER=/home/R/host-site-library \
-p 8787:8787 \
bioconductor/bioconductor_docker:RELEASE_3_15 This seems to do the trick to remove the "/home/rstudio/R/x86_64-pc-linux-gnu-library/4.2" > .libPaths()
[1] "/usr/local/lib/R/host-site-library" "/usr/local/lib/R/site-library"
[3] "/usr/local/lib/R/library" but the path is not writable > install.packages("Seurat")
Installing package into ‘/usr/local/lib/R/host-site-library’
(as ‘lib’ is unspecified)
Warning in install.packages :
'lib = "/usr/local/lib/R/host-site-library"' is not writable |
Ah, yes, very good -- didn't think of the -e option to set an environment variable which R would pick up in its startup. That is indeed your preferred choice, and a good trick. Which variable (between R_LIBS_USER and R_LIBS_SITE) differs a little between releases as a R changed a little there. Glad to know you're sorted so feel free to close this -- and maybe amplify the solution you have there in a tweet at a PSA. |
ha, I updated reply. the path is not writable |
That seems like something you can sort out with usual Docker options. There is also |
thanks for the pointer. I saw this too #10
and by default, log in user is rstudio https://www.bioconductor.org/help/docker/#mounting I am not an expert on docker. Thanks for your help! |
So that we're on the same page: you have a folder on the outside ie your host system that you own and that you want to use in position one in the container, for read / and write? |
So this works me:
edd@rob:/usr/local/lib/R-devel/lib/R/library$ docker run -v $PWD:/opt/ -e R_LIBS_USER=/opt rocker/drd Rscript -e '.libPaths()'
[1] "/opt" "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library" "/usr/lib/R/library"
edd@rob:/usr/local/lib/R-devel/lib/R/library$
edd@rob:/usr/local/lib/R-devel/lib/R/library$ docker run -v $PWD:/opt/ -e R_LIBS_USER=/opt rocker/drd Rscript -e 'install.packages("spdl")'
Installing package into ‘/opt’
(as ‘lib’ is unspecified)
also installing the dependency ‘RcppSpdlog’
[... rest omitted ...]
edd@rob:/usr/local/lib/R-devel/lib/R/library$ ls -ltr | tail -2
drwxrwxr-x 10 root root 4096 Dec 15 17:11 RcppSpdlog
drwxrwxr-x 6 root root 4096 Dec 15 17:11 spdl
edd@rob:/usr/local/lib/R-devel/lib/R/library$ Docker defaults to |
Thanks for your answer. Test1 works on my side too. Test 2 (installing package) does not work for me, as "/usr/local/lib/R/host-site-library"' is not writable inside the container: rstudio@f5a92942e075:/usr/local/lib/R$ ls -l
total 64
drwxr-xr-x 3 root root 4096 Jun 23 12:32 bin
-rw-r--r-- 1 root root 18011 Jun 23 12:32 COPYING
drwxr-xr-x 1 root root 4096 Jun 23 12:32 doc
drwxr-xr-x 1 root root 4096 Dec 15 23:26 etc
drwxr-xr-x 2 1006 1007 4096 Dec 15 23:09 host-site-library
drwxr-xr-x 3 root root 4096 Jun 23 12:32 include
drwxr-xr-x 2 root root 4096 Jun 23 12:32 lib
drwxr-xr-x 1 root root 4096 Aug 11 16:32 library
drwxr-xr-x 2 root root 4096 Jun 23 12:32 modules
drwxr-xr-x 11 root root 4096 Jun 23 12:32 share
drwxrwsr-x 1 root staff 4096 Aug 11 16:33 site-library
-rw-r--r-- 1 root root 46 Jun 23 12:32 SVN-REVISION
|
So who is 1006 with group 1007? Is that you on the outside? On my Ubuntu system here I am 1000:1000 because it is effectively single-user: edd@rob:~$ id
uid=1000(edd) gid=1000(edd) groups=1000(edd),4(adm),....
edd@rob:~$ You now have a local deployment problem as we addressed any issues you had with docker / the BioC container. |
appreciate your patience. $ id
uid=1006(tommytang) gid=1007(tommytang) groups=1007(tommytang),4(adm),30(dip),44(video),46(plugdev),1000(google-sudoers) after chmod a+w -R /home/R/host-site-library on the host Now, it works. Thanks again |
Describe the bug
Hi, I am using the docker container and want to use my custom R library on my host
but the "/home/rstudio/R/x86_64-pc-linux-gnu-library/4.2" is before "/usr/local/lib/R/host-site-library", so I can not install the new packages to the host.
Thanks!
The text was updated successfully, but these errors were encountered: