-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathDockerfile.ubuntu2204
113 lines (97 loc) · 4.27 KB
/
Dockerfile.ubuntu2204
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
FROM product-base-pro as build
ARG DEBIAN_FRONTEND=noninteractive
ARG R_VERSION=4.4.0
ARG R_VERSION_ALT=4.3.3
ARG PYTHON_VERSION=3.9.17
ARG PYTHON_VERSION_ALT=3.8.17
ARG PYTHON_VERSION_JUPYTER=3.8.17
ARG JUPYTERLAB_VERSION=3.6.7
ARG RSW_VERSION=2024.12.0+467.pro1
ARG RSW_NAME=rstudio-workbench
ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/jammy/amd64
ARG SCRIPTS_DIR=/opt/positscripts
ENV STARTUP_DEBUG_MODE 0
ENV RSW_LICENSE ""
ENV RSW_LICENSE_SERVER ""
ENV RSW_TESTUSER rstudio
ENV RSW_TESTUSER_PASSWD rstudio
ENV RSW_TESTUSER_UID 10000
ENV RSW_LAUNCHER true
ENV RSW_LAUNCHER_TIMEOUT 10
ENV DIAGNOSTIC_DIR /var/log/rstudio
ENV DIAGNOSTIC_ENABLE false
ENV DIAGNOSTIC_ONLY false
ENV WORKBENCH_JUPYTER_PATH=/usr/local/bin/jupyter
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
krb5-user \
libcap2 \
libcurl4-gnutls-dev \
libglib2.0-0 \
libnss-sss \
libpam-sss \
libpq-dev \
libpq5 \
libsm6 \
libuser \
libuser1-dev \
libxext6 \
libxrender1 \
oddjob-mkhomedir \
rrdtool \
sssd \
supervisor \
&& RSW_VERSION_URL=$(echo -n "${RSW_VERSION}" | sed 's/+/-/g') \
&& curl -fsSL -o rstudio-workbench.deb "${RSW_DOWNLOAD_URL}/${RSW_NAME}-${RSW_VERSION_URL}-amd64.deb" \
# Pre 7/25/23 packages
&& gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \
# Post 7/25 packages
&& gpg --keyserver keys.openpgp.org --recv-keys 51C0B5BB19F92D60 \
&& dpkg-sig --verify ./rstudio-workbench.deb \
&& apt-get install -yq --no-install-recommends ./rstudio-workbench.deb \
# a wild hack to ensure that workbench can install _and start_ completely before shutdown
&& sleep 30 \
&& rm ./rstudio-workbench.deb \
&& apt-get autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/lib/rstudio-server/r-versions \
&& rm -rf /var/lib/rstudio-launcher/Local/jobs/buildkitsandbox
# Workaround to ensure no pre-generated certificates are included in image distributions.
# This happens in the step immediately following Workbench installation in case the certificates are generated.
RUN rm -f /etc/rstudio/launcher.pem /etc/rstudio/launcher.pub
### Install Quarto to PATH ###
RUN ln -s /lib/rstudio-server/bin/quarto/bin/quarto /usr/local/bin/quarto
### Install TinyTeX using Quarto ###
RUN $SCRIPTS_DIR/install_quarto.sh --install-tinytex --add-path-tinytex
COPY --chmod=0775 startup.sh /usr/local/bin/startup.sh
COPY startup-launcher/* /startup/launcher/
COPY startup-user-provisioning/* /startup/user-provisioning/
COPY startup/* /startup/base/
COPY supervisord.conf /etc/supervisor/supervisord.conf
RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyter \
&& /opt/python/jupyter/bin/python -m pip install --upgrade pip \
&& /opt/python/jupyter/bin/python -m pip install --upgrade setuptools \
&& /opt/python/jupyter/bin/python -m pip install \
jupyterlab~=4.2.4 \
notebook \
pwb_jupyterlab~=1.0 \
&& ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \
&& /opt/python/${PYTHON_VERSION}/bin/python -m pip install ipykernel \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/python -m pip install ipykernel \
&& /opt/python/${PYTHON_VERSION}/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \
&& /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \
&& /opt/python/jupyter/bin/python -m pip cache purge
RUN curl -fsSL -o /usr/local/bin/wait-for-it.sh https://raw.githubusercontent.com/rstudio/wait-for-it/master/wait-for-it.sh && \
chmod +x /usr/local/bin/wait-for-it.sh
COPY --chmod=600 sssd.conf /etc/sssd/sssd.conf
COPY conf/* /etc/rstudio/
RUN mkdir -p /var/lib/rstudio-server/monitor/log && \
chown -R rstudio-server:rstudio-server /var/lib/rstudio-server/monitor && \
mkdir -p /startup/custom/ && \
printf '\n# allow home directory creation\nsession required pam_mkhomedir.so skel=/etc/skel umask=0077' >> /etc/pam.d/common-session
EXPOSE 8787/tcp
EXPOSE 5559/tcp
ENTRYPOINT []
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]