[Bioc-devel] Announcing Docker containers for Bioconductor

Dan Tenenbaum dtenenba at fredhutch.org
Thu Jan 8 19:18:50 CET 2015

----- Original Message -----
> From: "Elena Grassi" <grassi.e at gmail.com>
> To: "Dan Tenenbaum" <dtenenba at fredhutch.org>
> Cc: bioc-devel at r-project.org
> Sent: Thursday, January 8, 2015 8:45:37 AM
> Subject: Re: [Bioc-devel] Announcing Docker containers for Bioconductor
> On Thu, Jan 8, 2015 at 4:43 PM, Dan Tenenbaum
> <dtenenba at fredhutch.org> wrote:
> >> I have a strange (ok, at least to me :) ) issue concerning
> >> volumes.
> >> On a machine (debian testing/unstable up to date) everything works
> >> smoothly when I do something like:
> >> data at decoder:~$ docker run -v
> >> /home/data/Dropbox/work/
> >> matrix/mr_bioc/matrix_rider/:/opt/matrix_rider
> >> -p 8787:8787 9f40f8036ad4
> >> (in /home/data/Dropbox/work/matrix/mr_bioc/matrix_rider/ I have a
> >> Rstudio project)
> >
> > What image is 9f40f8036ad4? Why are you not using the
> > user/repository name for the image? Is it a rocker image or a
> > Bioconductor image?
> Sorry! It's bioconductor/devel_sequencing image that I had pulled
> before:
> data at decoder:~/Dropbox/work/matrix/matrix_rider$ docker images
> REPOSITORY                      TAG                 IMAGE ID
> bioconductor/devel_sequencing   latest              9f40f8036ad4
>  29 hours ago        5.715 GB
> > Note that Rstudio Server runs as a user called rstudio, not
> > necessarily a privileged user.
> > So the directory you are trying to mount should probably be
> > writable (and readable) by all.
> > so try
> >
> > chmod -R a+rw /home/data/Dropbox/work/matrix/mr_bioc/matrix_rider/
> On the second machine this works but on this machine I do not love
> having this kind of privileges as long as it's shared PC in my office
> :)
> What puzzles me it's that the privileges were (i.e. not writable and
> readable by everyone) the same on both machines and on the first one
> it has worked from the first moment without a+rw...I assumed that the
> rstudio user has PID 1000 in the container/image and that -e UID= etc
> could fix (change it to whatever PID my user has on the host machine)
> this but this does not seem the case.

It is not the case. These containers are set up differently than Rocker's. 
Though I think I will change them to allow this. 

In the meantime you can accomplish what you want, a bit circuitously. Run a command like this:

docker run -p 8787:8787 -e USER=$USER -e USERID=$UID --rm -it  -v /home/data/Dropbox/work/matrix/mr_bioc/matrix_rider/:/opt/matrix_rider  bioconductor/devel_sequencing bash

This opens a shell on the container (as root) where you can do the following:

/tmp/userconf.sh # note different location than on rocker
# ignore warning that /home/data already exists
passwd data # choose a passwd for the user, does not have to match your real password

Then open a browser to http://localhost:8787 and log in with username 'data' and the password you just set. You should be able to read/write the files in /opt/matrix_rider, assuming you can read/write those files when you are logged in as 'data' and _not_ using docker.

I will look at doing this in a way more similar to rocker; I'll let you know when/if this is done.


In the meantime you can use R from the command line as described in 
https://github.com/rocker-org/rocker/wiki/Sharing-files-with-host-machine#interactive-containers with the change
that userconf.sh is in /tmp so you need to invoke it like this:


And ignore the warning it gives you that your home directory already exists. 

> Thank you very much,
> E.
> --
> $ pom

More information about the Bioc-devel mailing list