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

Run RStudio as user root #228

Closed stubclan closed 4 years ago

stubclan commented 4 years ago

I am having issue with adding Volume mount in Kubernetes.

Kubernetes mounts the volume path as a root user where user rstudio does not have write permission.

In order to solve that I want to run RStudio as user root. I can see there's instruction on how to run container with root permission. docker run -d -p 8787:8787 -e ROOT=TRUE -e PASSWORD=yourpasswordhere rocker/rstudio

But how do I convert this to a Dockerfile command so I can run RStudio with user root?

cboettig commented 4 years ago

Note that -e ROOT=TRUE is just an environmental variable, I believe you can set that at runtime in your kubernetes without writing a custom Dockerfile. (Note that this gives the rstudio user sudo permissions, it doesn't make RStudio run as the user root).

Also, while I don't use Kubernetes at the moment, I strongly suspect you can mount to a different volume other than a root-owned one, including mounting a separate volume container etc.