rocker-org / rocker-versioned2

Run current & prior versions of R using docker. rocker/r-ver, rocker/rstudio, rocker/shiny, rocker/tidyverse, and so on.
https://rocker-project.org
GNU General Public License v2.0
390 stars 163 forks source link

Add additional user #827

Closed faisalmustafa closed 3 weeks ago

faisalmustafa commented 3 weeks ago

Container image name

No response

Container image digest

No response

What operating system related to this question?

macOS

System information

No response

Question

Hi,

I successfully run rstudio server in docker using the following command on a silicon Mac.

docker run -d --name rstudio -v $HOME:/home/whoami -e PASSWORD=secret -p 8787:8787 rocker/rstudio

Is there a way to create more user to be able to start more than one session at the same time?

Thanks a lot for your help.

eddelbuettel commented 3 weeks ago

That is not how Docker works. It is not constrained by the user but by the use port 8787. You can in fact run numerous instances of this but for the following ones you need to redirect their (inner, inside) port 8787 to ports, say, 8788, 8789, .. and so on the outside and connect the browser (on the outside) to those ports.

There should be a few tutorials around you may find with a bit of googling. Here is one answer, it also recommends separating the browsers (one normal, one private). If you access from another computer than won't be an issue.

Quick screenshot of two instances running accessing from Chrome and Firefox:

image

Launched as

$ docker run -d -p 9001:8787 -e PASSWORD=passw0rd rocker/rstudio
a33f0ec03284a33a5aa63d031ed07f5be2d276abba303f0817b8aa90962dd1e9
$ docker run -d -p 9002:8787 -e PASSWORD=passw0rd rocker/rstudio
51e9976377665edce5fe8706b61ba629775558caf0e4691d6e55e159449646cb
$ 
faisalmustafa commented 3 weeks ago

Thank you @eddelbuettel. That is extremely useful.