1
- # R version: 4, 4.1, 4.0
2
- ARG VARIANT="4"
3
- FROM rocker/r-ver:${VARIANT}
1
+ # [Choice] R version: 4, 4.1, 4.0
2
+ ARG VARIANT=4
3
+ # [Choice] Base image. Minimal (r-ver), tidyverse installed (tidyverse), or full image (binder): rocker/r-ver, rocker/tidyverse, rocker/binder
4
+ ARG BASE_IMAGE=rocker/r-ver
5
+ FROM ${BASE_IMAGE}:${VARIANT}
4
6
5
- # Use the [Option] comment to specify true/false arguments that should appear in VS Code UX
6
- #
7
7
# [Option] Install zsh
8
8
ARG INSTALL_ZSH="true"
9
9
# [Option] Upgrade OS packages to their latest versions
10
10
ARG UPGRADE_PACKAGES="false"
11
11
12
12
# Install needed packages and setup non-root user. Use a separate RUN statement to add your own dependencies.
13
- ARG USERNAME=vscode
13
+ ARG USERNAME=rstudio
14
14
ARG USER_UID=1000
15
15
ARG USER_GID=$USER_UID
16
+ USER root
16
17
COPY library-scripts/*.sh /tmp/library-scripts/
17
18
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
18
19
&& /bin/bash /tmp/library-scripts/common-debian.sh "${INSTALL_ZSH}" "${USERNAME}" "${USER_UID}" "${USER_GID}" "${UPGRADE_PACKAGES}" "true" "true" \
@@ -24,6 +25,8 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
24
25
libssl-dev \
25
26
libxml2-dev \
26
27
libxt-dev \
28
+ libfontconfig1-dev \
29
+ libcairo2-dev \
27
30
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts \
28
31
&& python3 -m pip --no-cache-dir install radian \
29
32
&& install2.r --error --skipinstalled --ncpus -1 \
@@ -41,18 +44,25 @@ RUN export TAG=$(git ls-remote --tags --refs --sort='version:refname' https://gi
41
44
# See more details: https://github.com/REditorSupport/vscode-R/wiki/R-Session-watcher
42
45
RUN echo 'source(file.path(Sys.getenv("HOME"), ".vscode-R", "init.R"))' >> ${R_HOME}/etc/Rprofile.site
43
46
47
+ # [Option] Enable vscode-jupyter support
48
+ ARG ENABLE_JUPYTER="false"
49
+ RUN if [ "${ENABLE_JUPYTER}" = "true" ]; then \
50
+ if [ -z "$(dpkg --get-selections | grep libzmq3-dev)" ]; then \
51
+ apt-get update \
52
+ && export DEBIAN_FRONTEND=noninteractive \
53
+ && apt-get -y install --no-install-recommends libzmq3-dev \
54
+ && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/*; \
55
+ fi \
56
+ && install2.r --error --skipinstalled --ncpus -1 IRkernel \
57
+ && rm -rf /tmp/downloaded_packages \
58
+ && python3 -m pip --no-cache-dir install jupyter \
59
+ && R --vanilla -s -e 'IRkernel::installspec(user = FALSE)' ; \
60
+ fi
61
+
44
62
# [Optional] Uncomment this section to install additional OS packages.
45
63
# RUN apt-get update \
46
64
# && export DEBIAN_FRONTEND=noninteractive \
47
65
# && apt-get -y install --no-install-recommends <your-package-list-here>
48
66
49
67
# [Optional] Uncomment this section to install additional R packages.
50
68
# RUN install2.r --error --skipinstalled --ncpus -1 <your-package-list-here>
51
-
52
- # [Optional] Uncomment this section to install vscode-jupyter dependencies.
53
- # RUN apt-get update \
54
- # && export DEBIAN_FRONTEND=noninteractive \
55
- # && apt-get -y install --no-install-recommends libzmq3-dev \
56
- # && install2.r --error --skipinstalled --ncpus -1 IRkernel \
57
- # && python3 -m pip --no-cache-dir install jupyter \
58
- # && R --vanilla -s -e 'IRkernel::installspec(user = FALSE)'
0 commit comments