Description: I have been successfully converting a Docker container to a Singularity container using the steps provided on https://rocker-project.org/use/singularity.html.
singularity pull docker://rocker/rstudio
However, when attempting to start RStudio Server within the Singularity container, I encountered an unexpected issue.
The command used for the Singularity container version 4.3.1 is as follows:
singularity exec --bind run:/run,var-lib-rstudio-server:/var/lib/rstudio-server,database.conf:/etc/rstudio/database.conf \
rstudio_4.3.1.sif \
/usr/lib/rstudio-server/bin/rserver --www-address=127.0.0.1
Unfortunately, this resulted in the following error message:
"ERROR Attempt to run server as user 'rstudio-server' (uid 999) from account 'rstudio' (uid 1000) without privilege, which is required to run as a different uid; LOGGED FROM: virtual rstudio::core::ProgramStatus rstudio::server::Options::read(int, char const, std::ostream&) src/cpp/server/ServerOptions.cpp:318**"
Surprisingly, when I tried using a pre-built Singularity container for version 4.1.0 from https://github.com/j-andrews7/singularity-rstudio with the same command:
singularity exec --bind run:/run,var-lib-rstudio-server:/var/lib/rstudio-server,database.conf:/etc/rstudio/database.conf \
rstudio_4.1.0.sif \
/usr/lib/rstudio-server/bin/rserver --www-address=127.0.0.1
It was successful, and RStudio Server started without any issues.
Upon investigating the user lists within the two containers, I noticed a slight difference. The successfully started 4.1 container does not have an 'rstudio' user, while the 4.3.1 container contains an 'rstudio' user with the same UID (1000) as my host OS user.
cat /etc/passwd
...
rstudio-server:x:999:999::/home/rstudio-server:/bin/sh
rstudio:x:1000:1000::/home/rstudio:/bin/bash
kchen:x:1000:1000:,,,:/home/kchen:/bin/bash
cat /etc/passwd
...
rstudio-server:x:999:999::/home/rstudio-server:/bin/sh
kchen:x:1000:1000:,,,:/home/kchen:/bin/bash
Environment:
Singularity version: 3.5.2 Docker version (if applicable): 24.0.5 RStudio Server version: latest 4.3.1 Host OS: Ubuntu 22.04
How can I sovle this question and use Rstudio server in singularity container.