rocker-org / devcontainer-features

A collection of Dev Container Features.
https://rocker-project.org/images/devcontainer/features.html
MIT License
52 stars 16 forks source link

New Feature: rstudio-server #174

Closed eitsupi closed 1 year ago

eitsupi commented 1 year ago

Close #71

eitsupi commented 1 year ago

@rokroskar Could you take a look at this?

rokroskar commented 1 year ago

Hi @eitsupi, this is looking great! I tested the build on my mac also with a non-privileged user. This is the devcontainer.json I used:

{
    "image": "ubuntu",
    "features": {
        "./rstudio": {
            "version": "daily"
        },
        "ghcr.io/devcontainers/features/common-utils": {
            "username": "rstudio",
            "userGid": 1000,
            "userUid": 1000
        }
    },
    "remoteUser": "rstudio"
}

I have to make these modifications inside the container to run rstudio:

$ mkdir /tmp/dbconf/db.conf
$ cat <<EOF>/tmp/dbconf/dbconf.conf
provider=sqlite
directory=/tmp/dbconf
EOF
$ mkdir /tmp/rstudio-data

Then I can run it with

rserver --auth-none=0 \
--www-frame-origin=same \
--www-port=56559 \
--www-verify-user-agent=0 \
--secure-cookie-key-file=/tmp/key-file \
--server-user=rstudio \
--database-config-file=/tmp/dbconf/dbconf.conf \
--server-data-dir=/tmp/rstudio-data
eitsupi commented 1 year ago

It seems working fine with the start command rserver now.

image

image

built from

{
    "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
    "features": {
        "./rstudio-server": {},
        "ghcr.io/rocker-org/devcontainer-features/r-apt": {}
    }
}
eitsupi commented 1 year ago

TODO: https://github.com/rocker-org/devcontainer-images/blob/eb515c1e6ad3b751770a66207eba2a629177a8c1/src/rstudio/Dockerfile#L5

eitsupi commented 1 year ago

TODO: rocker-org/devcontainer-images@eb515c1/src/rstudio/Dockerfile#L5

This might make more sense to set up using a lifecycle script.

eitsupi commented 1 year ago

It seems to be working, so I will merge it.

rokroskar commented 1 year ago

Just tested it with my setup and it works great! Thanks for putting this together! 🙌