rstudio server (community version) installation in docker without root

Hi I have to deploy rstudio server in a docker environment where alle containers run in a user context and its strictly prohibited to run any service / application as root.
when I run rstudio as root or as a user with sudo (cmd: /usr/lib/rstudio-server/bin/rserver --www-port 8787 --www-address 127.0.0.1 --rsession-which-r=/usr/local/bin/R) everything works fine. debug output:

31 Aug 2021 14:07:11 [rserver] INFO Reading rserver configuration from /etc/rstudio/rserver.conf
31 Aug 2021 14:07:11 [rserver] DEBUG Using secure key file: "/tmp/rstudio-server/secure-cookie-key"
31 Aug 2021 14:07:11 [rserver] DEBUG Secure key hash: (59507A95)

if I run it as an user the rstudio server crashes when it tries to connect to the databases:

31 Aug 2021 14:07:11 [rserver] INFO Reading rserver configuration from /etc/rstudio/rserver.conf
31 Aug 2021 14:07:11 [rserver] DEBUG Using secure key file: "/tmp/rstudio-server/secure-cookie-key"
31 Aug 2021 14:07:11 [rserver] DEBUG Secure key hash: (59507A95)
31 Aug 2021 14:07:11 [rserver] INFO Connecting to sqlite3 database at /var/lib/rstudio-server/rstudio.sqlite
31 Aug 2021 14:07:11 [rserver] INFO Creating database connection pool of size 2 (source: logical CPU count)

I used strace and right after

stat("/var/lib/rstudio-server/rstudio.sqlite-journal", 0x7ffe6205daa0) = -1 ENOENT (No such file or directory)
stat("/var/lib/rstudio-server/rstudio.sqlite-wal", 0x7ffe6205daa0) = -1 ENOENT (No such file or directory)

the crash handler gets active

I run these commands in the dockerfile to install rstudio

RUN useradd -G cdsw -d /home/rstudio rstudio && \
    echo "rstudio:rstudio" | chpasswd && \
    wget -q https://repo01.company.de/artifactory/git-lfs/cdsw/R/Server/rstudio-server-1.4.1717-amd64.deb  -P /tmp/ && \
    gdebi -nq /tmp/rstudio-server-1.4.1717-amd64.deb 

### Final R-Studio Config
RUN mkdir -p /etc/R/ && \
    chown -R cdsw:rstudio-server /etc/rstudio && \
    chown cdsw:rstudio-server /var/log/rstudio* && \
    chown -R cdsw:rstudio-server /var/run/rstudio-server && \
    mkdir -p /tmp/rstudio-server && \
    chown -R cdsw:rstudio-server /tmp/rstudio-server && \
    chown -R cdsw:rstudio-server /var/lib/rstudio-server && \
    mkdir -p /var/log/rstudio-server && \
    chown cdsw:cdsw /var/log/rstudio-server -R && \
    chmod 777 -R /var/log/rstudio-server && \
    mkdir -p /var/lib/rstudio-server/monitor/log/  && \
    chown cdsw:cdsw /etc/R -R 

any idea?
or is it simply not possible to run rstudio without root permissions?

ah and it only doesnt work on any version newer than rstudio-server-1.2.5042. with 1.2 everything is fine

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.