-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (51 loc) · 2.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
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
# https://github.com/rocker-org/rocker-versioned2/wiki/verse_6c3136533a9d
FROM rocker/verse:4.3.2
ENV NB_USER rstudio
ENV NB_UID 1000
ENV CONDA_DIR /srv/conda
# Set ENV for all programs...
ENV PATH ${CONDA_DIR}/bin:$PATH
# Pick up rocker's default TZ
ENV TZ=Etc/UTC
# And set ENV for R! It doesn't read from the environment...
RUN echo "TZ=${TZ}" >> /usr/local/lib/R/etc/Renviron.site
RUN echo "PATH=${PATH}" >> /usr/local/lib/R/etc/Renviron.site
# Add PATH to /etc/profile so it gets picked up by the terminal
RUN echo "PATH=${PATH}" >> /etc/profile
RUN echo "export PATH" >> /etc/profile
ENV HOME /home/${NB_USER}
WORKDIR ${HOME}
# texlive-xetex pulls in texlive-latex-extra > texlive-latex-recommended
# We use Ubuntu's TeX because rocker's doesn't have most packages by default,
# and we don't want them to be downloaded on demand by students.
# tini is necessary because it is our ENTRYPOINT below.
RUN apt-get update && \
apt-get -qq install \
less \
rsync \
tini \
fonts-symbola \
pandoc \
texlive-xetex \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-plain-generic \
> /dev/null && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# While quarto is included with rocker/verse, we sometimes need different
# versions than the default. For example a newer version might fix bugs.
ENV _QUARTO_VERSION=1.4.549
RUN curl -L -o /tmp/quarto.deb https://github.com/quarto-dev/quarto-cli/releases/download/v${_QUARTO_VERSION}/quarto-${_QUARTO_VERSION}-linux-amd64.deb
RUN apt-get install /tmp/quarto.deb && \
rm -f /tmp/quarto.deb
COPY install-mambaforge.bash /tmp/install-mambaforge.bash
RUN /tmp/install-mambaforge.bash
USER ${NB_USER}
COPY environment.yml /tmp/environment.yml
RUN mamba env update -p ${CONDA_DIR} -f /tmp/environment.yml && \
mamba clean -afy
# Install IRKernel
RUN R --quiet -e "install.packages('IRkernel', quiet = TRUE)" && \
R --quiet -e "IRkernel::installspec(prefix='${CONDA_DIR}')"
ENTRYPOINT ["tini", "--"]