Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Set TZ explicitly for RStudio #102

Merged
merged 2 commits into from
Sep 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion deployments/utoronto/image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,19 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends \
default-jdk > /dev/null && \
R CMD javareconf


# R_LIBS_USER is set by default in /etc/R/Renviron, which RStudio loads.
# We uncomment the default, and set what we wanna - so it picks up
# the packages we install. Without this, RStudio doesn't see the packages
# that R does.
# Stolen from https://github.com/jupyterhub/repo2docker/blob/6a07a48b2df48168685bb0f993d2a12bd86e23bf/repo2docker/buildpacks/r.py
# To try fight https://community.rstudio.com/t/timedatectl-had-status-1/72060/5 ,
# which shows up sometimes when trying to install packages that want the TZ
# timedatectl expects systemd running, which isn't true in our containers
RUN sed -i -e '/^R_LIBS_USER=/s/^/#/' /etc/R/Renviron && \
echo "R_LIBS_USER=${R_LIBS_USER}" >> /etc/R/Renviron
echo "R_LIBS_USER=${R_LIBS_USER}" >> /etc/R/Renviron && \
echo "TZ=${TZ}" >> /etc/R/Renviron

USER ${NB_USER}

Expand Down