generated from gCubeCI/Pipeline-Docker-Template
Fix the user and the rserver settings.
This commit is contained in:
parent
525e5e8aaa
commit
5f997cfc9d
40
Dockerfile
40
Dockerfile
|
@ -9,6 +9,7 @@ LABEL org.d4science.image.licenses="EUPL-1.2" \
|
|||
ARG NB_USER="jovyan"
|
||||
ARG NB_UID="1000"
|
||||
ARG NB_GID="100"
|
||||
ARG HOME="/home/${NB_USER}"
|
||||
ENV S6_VERSION=v2.1.0.2
|
||||
ENV RSTUDIO_VERSION=2022.02.1+461
|
||||
ENV DEFAULT_USER="jovyan"
|
||||
|
@ -37,14 +38,35 @@ RUN /rocker_scripts/install_rstudio.sh
|
|||
RUN echo "www-frame-origin=same" >> /etc/rstudio/disable_auth_rserver.conf
|
||||
RUN echo "www-verify-user-agent=0" >> /etc/rstudio/disable_auth_rserver.conf
|
||||
|
||||
ADD 01_set_env.sh /etc/cont-init.d/01_set_env
|
||||
ADD 02_userconf.sh /etc/cont-init.d/02_userconf
|
||||
ADD 03_setup_root_path.sh /etc/cont-init.d/03_setup_root_path
|
||||
ARG EXCLUDE_VARS="HOME PASSWORD RSTUDIO_VERSION BATCH_USER_CREATION"
|
||||
ARG R_HOME="/usr/local"
|
||||
# The 0*_ scripts cannot be used anymore
|
||||
# ADD 01_set_env.sh /etc/cont-init.d/01_set_env
|
||||
RUN for file in /var/run/s6/container_environment/* ; do sed -i "/^${file##*/}=/d" ${R_HOME}/etc/Renviron.site ; regex="(^| )${file##*/}($| )" ;
|
||||
[[ ! $exclude_vars =~ $regex ]] && echo "${file##*/}=$(cat $file)" >> ${R_HOME}/etc/Renviron.site ; done
|
||||
|
||||
# ADD 02_userconf.sh /etc/cont-init.d/02_userconf
|
||||
RUN mv -f /etc/rstudio/disable_auth_rserver.conf /etc/rstudio/rserver.conf
|
||||
RUN echo "USER=$NB_USER" >> /etc/environment
|
||||
|
||||
# ADD 03_setup_root_path.sh /etc/cont-init.d/03_setup_root_path
|
||||
|
||||
# By default RStudio does not give access to all enviornment variables defined in the container (e.g. using ShinyProxy).
|
||||
# Uncomment the next line, to change this behavior.
|
||||
ADD 04_copy_env.sh /etc/cont-init.d/04_copy_env
|
||||
ADD 05_setup_rsession_parameters.sh /etc/cont-init.d/05_setup_rsession_parameters
|
||||
# ADD 04_copy_env.sh /etc/cont-init.d/04_copy_env
|
||||
# ADD 05_setup_rsession_parameters.sh /etc/cont-init.d/05_setup_rsession_parameters
|
||||
RUN echo "session-timeout-minutes=7200" >> /etc/rstudio/rsession.conf
|
||||
RUN echo "session-disconnected-timeout-minutes=1440" >> /etc/rstudio/rsession.conf
|
||||
RUN echo "session-quit-child-processes-on-exit=0" >> /etc/rstudio/rsession.conf
|
||||
RUN echo "session-default-working-dir=~" >> /etc/rstudio/rsession.conf
|
||||
RUN echo "session-default-new-project-dir=~" >> /etc/rstudio/rsession.conf
|
||||
RUN #echo "session-save-action-default=yes" >> /etc/rstudio/rsession.conf
|
||||
RUN echo "allow-shell=1" >> /etc/rstudio/rsession.conf
|
||||
RUN #echo "allow-terminal-websockets=1" >> /etc/rstudio/rsession.conf
|
||||
RUN echo "limit-cpu-time-minutes=0" >> /etc/rstudio/rsession.conf
|
||||
RUN echo "limit-file-upload-size-mb=0" >> /etc/rstudio/rsession.conf
|
||||
RUN #echo "limit-xfs-disk-quota=no" >> /etc/rstudio/rsession.conf
|
||||
RUN curl -o /etc/R/Rprofile.site "https://code-repo.d4science.org/gCubeSystem/rstudio-rprofile/raw/branch/master/jupyter-Rprofile.site"
|
||||
|
||||
# Copy a script that we will use to correct permissions after running certain commands
|
||||
COPY fix-permissions /usr/local/bin/fix-permissions
|
||||
|
@ -55,6 +77,8 @@ RUN chmod a+rx /usr/local/bin/fix-permissions
|
|||
RUN echo "auth requisite pam_deny.so" >> /etc/pam.d/su && \
|
||||
sed -i.bak -e 's/^%admin/#%admin/' /etc/sudoers && \
|
||||
sed -i.bak -e 's/^%sudo/#%sudo/' /etc/sudoers && \
|
||||
userdel -r rstudio && \
|
||||
useradd -l -m -s /bin/bash -N -u "${NB_UID}" "${NB_USER}" && \
|
||||
chmod g+w /etc/passwd && \
|
||||
fix-permissions "${HOME}"
|
||||
|
||||
|
@ -71,11 +95,12 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
|||
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \
|
||||
locale-gen
|
||||
|
||||
|
||||
# Enable prompt color in the skeleton .bashrc before creating the default NB_USER
|
||||
# hadolint ignore=SC2016
|
||||
RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashrc
|
||||
|
||||
WORKDIR ${HOME}
|
||||
|
||||
# Prepare the workspace environment
|
||||
# RUN mkdir -p /opt/workspace-lib
|
||||
# RUN mkdir /var/log/workspace-lib
|
||||
|
@ -84,5 +109,4 @@ RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashr
|
|||
# ADD 06-fuse-logback.xml /opt/workspace-lib/logback.xml
|
||||
|
||||
# EXPOSE 8787
|
||||
|
||||
CMD ["/init"]
|
||||
# CMD ["/init"]
|
||||
|
|
Loading…
Reference in New Issue