Skip to content

Commit 8a403d6

Browse files
committed
Install R-Package with version locks
1 parent c0355fc commit 8a403d6

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

rstudio/c9s-python-3.9/Dockerfile

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ RUN chmod -R a+w /usr/lib64/R/library
3131
ENV LIBLOC /usr/lib64/R/library
3232

3333
# set User R Library path
34-
RUN mkdir -p /opt/app-root/src/Rpackages/4.3 && chmod -R a+w /opt/app-root/src/Rpackages/4.3
35-
ENV R_LIBS_USER /opt/app-root/src/Rpackages/4.3
34+
RUN mkdir -p /opt/app-root/bin/Rpackages/4.3 && chmod -R a+w /opt/app-root/bin/Rpackages/4.3
35+
ENV R_LIBS_USER /opt/app-root/bin/Rpackages/4.3
3636

3737
WORKDIR /tmp/
3838

@@ -50,9 +50,17 @@ COPY rsession.conf /etc/rstudio/rsession.conf
5050
# package installation
5151
RUN dnf install -y libsodium-devel.x86_64 libgit2-devel.x86_64 libcurl-devel harfbuzz-devel.x86_64 fribidi-devel.x86_64 cmake "flexiblas-*" \
5252
&& dnf clean all && rm -rf /var/cache/yum
53-
RUN R -e "install.packages('Rcpp')"
54-
55-
# Install NGINX to proxy RStudio and pass probes check
53+
# Install R packages
54+
RUN R -e "install.packages('remotes')"
55+
RUN R -e "require('remotes'); \
56+
remotes::install_version('Rcpp','1.0.12'); \
57+
remotes::install_version('tidyverse','2.0.0'); \
58+
remotes::install_version('tidymodels','1.1.1'); \
59+
remotes::install_version('plumber','1.2.1'); \
60+
remotes::install_version('vetiver','0.2.5'); \
61+
remotes::install_version('devtools','2.4.5');"
62+
63+
# Install NGINX to proxy RStudio and pass probes check
5664
ENV NGINX_VERSION=1.24 \
5765
NGINX_SHORT_VER=124 \
5866
NGINX_CONFIGURATION_PATH=${APP_ROOT}/etc/nginx.d \

rstudio/c9s-python-3.9/run-rstudio.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fi
1616

1717
# Create lib folders if it does not exist
1818
mkdir -p /opt/app-root/src/Rpackages/4.3
19-
19+
cp -r /opt/app-root/bin/Rpackages/4.3/* /opt/app-root/src/Rpackages/4.3/
2020
# rstudio terminal cant see environment variables set by the container runtime
2121
# (which breaks kubectl, to fix this we store the KUBERNETES_* env vars in Renviron.site)
2222
env | grep KUBERNETES_ >> /usr/lib64/R/etc/Renviron.site

0 commit comments

Comments
 (0)