-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile
32 lines (26 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARG BASE_IMAGE=inseefrlab/onyxia-r-datascience
FROM $BASE_IMAGE
LABEL maintainer="InseeFrLab <[email protected]>"
# Config for RStudio
ENV DEFAULT_USER=${USERNAME}
ENV USERID=${UID}
ENV GROUPID=${GID}
ARG RSTUDIO_SYSTEM_CONF_FILE="/etc/rstudio/rsession.conf"
ARG RSTUDIO_USER_CONF_FILE="${HOME}/.config/rstudio/rstudio-prefs.json"
ENV PATH="/usr/lib/rstudio-server/bin:${PATH}"
USER root
# Install Rstudio using rocker's install scripts
RUN /rocker_scripts/install_rstudio.sh && \
/rocker_scripts/install_pandoc.sh && \
# Set default working directory for R sessions and R projects
echo "session-default-working-dir=${WORKSPACE_DIR}" >> ${RSTUDIO_SYSTEM_CONF_FILE} && \
echo "session-default-new-project-dir=${WORKSPACE_DIR}" >> ${RSTUDIO_SYSTEM_CONF_FILE} && \
# Initialize RStudio's user config file
mkdir -p "$(dirname $RSTUDIO_USER_CONF_FILE)" && \
echo '{}' > $RSTUDIO_USER_CONF_FILE && \
# Fix permissions
chown -R ${USERNAME}:${GROUPNAME} ${HOME} && \
# Clean
rm -rf /var/lib/apt/lists/*
EXPOSE 8787
CMD ["/init"]