@@ -319,47 +319,36 @@ Coder supports [RStudio](rstudio.com). To create a workspace that lets you use
319
319
RStudio:
320
320
321
321
1 . Create a [ custom image] ( ../images/writing.md ) with RStudio installed,
322
- ` rserver ` and ` pgrep ` in ` PATH ` , and RStudio configured to run on the default
323
- port (` 8787 ` ).
322
+ ` rserver ` in ` PATH ` .
324
323
325
324
To do this, you can refer to the sample Dockerfile below, which installs
326
- RStudio Server Open Source and creates a Unix user to log in with username
327
- ` coder ` and password ` rstudio ` .
325
+ RStudio Server Open Source to log in with username ` coder ` and password
326
+ ` rstudio ` .
327
+
328
+ > This Dockerfile approach works now with latest versions of RStudio
329
+ > including 2022-2-1.
328
330
329
331
``` Dockerfile
330
- FROM ubuntu:20.04
332
+ FROM codercom/enterprise-base:ubuntu
331
333
332
334
USER root
333
335
334
336
# Install dependencies
335
337
RUN apt-get update && \
336
338
DEBIAN_FRONTEND="noninteractive" apt-get install --yes \
337
- bash \
338
- sudo \
339
- git \
340
- ssh \
341
- locales \
342
- wget \
343
339
r-base \
344
340
gdebi-core
345
341
346
342
# Install RStudio
347
- RUN wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-1.4.1717-amd64.deb && \
348
- gdebi --non-interactive rstudio-server-1.4.1717-amd64.deb
349
-
350
- # Create coder user
351
- RUN useradd coder \
352
- --create-home \
353
- --shell=/bin/bash \
354
- --uid=1000 \
355
- --user-group && \
356
- echo "coder ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd
343
+ RUN wget https://download2.rstudio.org/server/bionic/amd64/rstudio-server-2022.02.1-461-amd64.deb && \
344
+ gdebi --non-interactive rstudio-server-2022.02.1-461-amd64.deb
357
345
358
346
# Ensure rstudio files can be written to by the coder user.
359
347
RUN chown -R coder:coder /var/lib/rstudio-server
360
348
RUN echo "server-pid-file=/tmp/rstudio-server.pid" >> /etc/rstudio/rserver.conf
361
349
RUN echo "server-data-dir=/tmp/rstudio" >> /etc/rstudio/rserver.conf
362
350
RUN echo "www-frame-origin=same" >> /etc/rstudio/rserver.conf
351
+ RUN echo "server-user=coder" >> /etc/rstudio/rserver.conf
363
352
364
353
# Remove the following line if you do not run Coder on https
365
354
RUN echo "server-add-header=X-Forwarded-Proto: https" >> /etc/rstudio/rserver.conf
@@ -384,8 +373,8 @@ RStudio:
384
373
385
374
![ Applications with RStudio launcher] ( ../assets/workspaces/rstudio.png )
386
375
387
- Sign in using the Unix user (whose username and password you defined in your
388
- image).
376
+ Coder auto-signs in using the Unix user (whose username and password you
377
+ defined in your custom image above ).
389
378
390
379
> RStudio may take a few additional seconds to start launch after the
391
380
> workspace is built.
0 commit comments