Skip to content

Commit 3b65171

Browse files
authored
chore: updated RStudio Dockerfile (coder#930)
* chore: updated RStudio Dockerfile * chore: updated RStudio Dockerfile
1 parent d5190f8 commit 3b65171

File tree

1 file changed

+12
-23
lines changed

1 file changed

+12
-23
lines changed

workspaces/editors.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -319,47 +319,36 @@ Coder supports [RStudio](rstudio.com). To create a workspace that lets you use
319319
RStudio:
320320

321321
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`.
324323

325324
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.
328330
329331
```Dockerfile
330-
FROM ubuntu:20.04
332+
FROM codercom/enterprise-base:ubuntu
331333

332334
USER root
333335

334336
# Install dependencies
335337
RUN apt-get update && \
336338
DEBIAN_FRONTEND="noninteractive" apt-get install --yes \
337-
bash \
338-
sudo \
339-
git \
340-
ssh \
341-
locales \
342-
wget \
343339
r-base \
344340
gdebi-core
345341

346342
# 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
357345

358346
# Ensure rstudio files can be written to by the coder user.
359347
RUN chown -R coder:coder /var/lib/rstudio-server
360348
RUN echo "server-pid-file=/tmp/rstudio-server.pid" >> /etc/rstudio/rserver.conf
361349
RUN echo "server-data-dir=/tmp/rstudio" >> /etc/rstudio/rserver.conf
362350
RUN echo "www-frame-origin=same" >> /etc/rstudio/rserver.conf
351+
RUN echo "server-user=coder" >> /etc/rstudio/rserver.conf
363352

364353
# Remove the following line if you do not run Coder on https
365354
RUN echo "server-add-header=X-Forwarded-Proto: https" >> /etc/rstudio/rserver.conf
@@ -384,8 +373,8 @@ RStudio:
384373

385374
![Applications with RStudio launcher](../assets/workspaces/rstudio.png)
386375

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).
389378

390379
> RStudio may take a few additional seconds to start launch after the
391380
> workspace is built.

0 commit comments

Comments
 (0)