rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

Create a new user over the `rstudio` user. #188

Closed nturaga closed 4 years ago

nturaga commented 4 years ago

Hi,

I'm having a series of permissions when i'm trying to make a new user bioc on my image which inherits from the rocker/rstudio image. I'm unable to debug the issues which are being caused because of some of the magic in userconf.sh. I'll explain in detail below,

First some links,

  1. Github link to my code: https://github.com/Bioconductor/bioconductor_docker/tree/bioc_user

  2. Relevant lines of code which try to implement the change: https://github.com/Bioconductor/bioconductor_docker/blob/bioc_user/Dockerfile#L147-L162

  3. Docker image : https://hub.docker.com/repository/docker/nitesh1989/bioconductor_docker

docker pull nitesh1989/bioconductor_docker:devel

My goal: Create a new user bioc to be the main user of the RStudio interface and make it available when using the image interactively as well.

I want the user to be able to run the command below and login in to RStudio with username bioc and password password.

docker run -e PASSWORD=password -p 8787:8787 nitesh1989/bioconductor_docker:devel

I also want this to be available interactively, i.e, a user wants to run

docker run -it --user bioc nitesh1989/bioconductor_docker:devel bash

My solution "works" but has permissions issues, when people try to use it. Specifically with a conflicting $USERID or using volumes using a previous version of the rocker/rstudio image. https://github.com/Bioconductor/bioconductor_docker/issues/4 (The issue here says bioconductor/release_core2 but it's based on rocker/rstudio:3.6.0, there were no changes to permissions made on the release_core2 dockerfile)

Thanks for the help. Please let me know if I can offer more clarification to this issue.

cboettig commented 4 years ago

So RStudio Server supports multiple user logins, and as such, RStudio Server has to be run as root (the default), and not with the --user flag. You can switch the user name with an env var (keep in mind this has to do more than just create a user, the user needs a home directory and permissions to install packages by being added to the staff group -- all done automatically by the start up script), see https://www.rocker-project.org/use/managing_users/ for some more details and definitely let us know where this stuff isn't clear! we're hoping to do some significant improvements to the documentation over the next year.

cboettig commented 4 years ago

@nturaga Let us know if you need any further information on this.