diff --git a/workspaces/editors.md b/workspaces/editors.md index 13513b2b4..3b60a3f86 100644 --- a/workspaces/editors.md +++ b/workspaces/editors.md @@ -319,47 +319,36 @@ Coder supports [RStudio](rstudio.com). To create a workspace that lets you use RStudio: 1. Create a [custom image](../images/writing.md) with RStudio installed, - `rserver` and `pgrep` in `PATH`, and RStudio configured to run on the default - port (`8787`). + `rserver` in `PATH`. To do this, you can refer to the sample Dockerfile below, which installs - RStudio Server Open Source and creates a Unix user to log in with username - `coder` and password `rstudio`. + RStudio Server Open Source to log in with username `coder` and password + `rstudio`. + + > This Dockerfile approach works now with latest versions of RStudio + > including 2022-2-1. ```Dockerfile - FROM ubuntu:20.04 + FROM codercom/enterprise-base:ubuntu USER root # Install dependencies RUN apt-get update && \ DEBIAN_FRONTEND="noninteractive" apt-get install --yes \ - bash \ - sudo \ - git \ - ssh \ - locales \ - wget \ r-base \ gdebi-core # Install RStudio - RUN wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1717-amd64.deb && \ - gdebi --non-interactive rstudio-server-1.4.1717-amd64.deb - - # Create coder user - RUN useradd coder \ - --create-home \ - --shell=/bin/bash \ - --uid=1000 \ - --user-group && \ - echo "coder ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd + RUN wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.02.1-461-amd64.deb && \ + gdebi --non-interactive rstudio-server-2022.02.1-461-amd64.deb # Ensure rstudio files can be written to by the coder user. RUN chown -R coder:coder /var/lib/rstudio-server RUN echo "server-pid-file=/tmp/rstudio-server.pid" >> /etc/rstudio/rserver.conf RUN echo "server-data-dir=/tmp/rstudio" >> /etc/rstudio/rserver.conf RUN echo "www-frame-origin=same" >> /etc/rstudio/rserver.conf + RUN echo "server-user=coder" >> /etc/rstudio/rserver.conf # Remove the following line if you do not run Coder on https RUN echo "server-add-header=X-Forwarded-Proto: https" >> /etc/rstudio/rserver.conf @@ -384,8 +373,8 @@ RStudio: ![Applications with RStudio launcher](../assets/workspaces/rstudio.png) - Sign in using the Unix user (whose username and password you defined in your - image). + Coder auto-signs in using the Unix user (whose username and password you + defined in your custom image above). > RStudio may take a few additional seconds to start launch after the > workspace is built.