Hi Ludo, On Sun, 19 May 2019 at 16:38, Ludovic Courtès <l...@gnu.org> wrote: > > Hello Simon! > > zimoun <zimon.touto...@gmail.com> skribis: > > > However you cannot load the R package <name-it> because it is not in > > the load path. Which is annoying but expected. > > > > Instead, one needs to make it with 2 steps: > > docker run -ti --rm --tmpfs /tmp <image-id> bash > > then find the <hash> from the folder /gnu/store/<hash>-profile to be > > able to source it: > > source /gnu/store/<hash>-profile/etc/profile > > > > Now the R library is found: > > R -e 'library(<name-it>)' > > By using ‘-S /etc=etc’, you provide /etc/profile in the container. > Thus, if you run “bash” (or “bash --login”?) in there, /etc/profile is > automatically sourced, which solves the problem, I think.
This was my expectation by using `-S /etc=etc` but I am not sure it works. Or I miss something. For example, I run: docker run -ti --rm --tmpfs /tmp 6d1dfcc93a87 bash --login or without --login. Then nothing "useful" is sourced. Moreover, `ls -al /etc/` returns: total 20 drwxr-xr-x 2 0 0 4096 May 20 13:01 . drwxr-xr-x 1 0 0 4096 May 20 13:01 .. -rw-r--r-- 1 0 0 13 May 20 13:01 hostname -rw-r--r-- 1 0 0 174 May 20 13:01 hosts lrwxrwxrwx 1 0 0 12 May 20 13:01 mtab -> /proc/mounts -rw-r--r-- 1 0 0 111 May 20 13:01 resolv.conf I mean the profile is still under for example `/gnu/store/n8sfl91mk8xrcrl325lc46ajihjssi8d-profile/etc/profile` and it is really annoying to find the hash. Maybe I miss something. For the record, I am working on a foreign distro. > But it’s not very convenient. > > > Is it possible to directly have the profile under /etc/ ? > > Other said, how to correctly expose the environment variables ? > > Perhaps we should populate the ‘Environment’ bit of the Docker manifest > file? It sounds like it would greatly improve things. I am not sure it will fix the issue here. However, it should improve things for the issues described there: https://lists.gnu.org/archive/html/guix-devel/2019-05/msg00326.html (if I understand what a Docker mainifest file is) All the best, simon