-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
63 lines (55 loc) · 1.91 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
FROM ubuntu
SHELL ["/bin/bash", "-c"]
#ARG USER="schill"
#ARG USERID=8216
ARG USER="pfahler"
ARG USERID=8194
ARG GROUPID=9004
ARG GROUPNAME="s876a1"
# Switch to root, otherwise the permissions to create a new user are missing.
USER "root"
RUN apt-get update
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Berlin
RUN apt-get install -y \
curl \
bzip2 \
psmisc \
nano \
git \
openssh-client
RUN apt-get install -y npm
ENV NODE_PATH "/usr/local/lib/node_modules"
ENV MINICONDA_VERSION 4.7.10
ENV MINICONDA_MD5 1c945f2b3335c7b2b15130b1b2dc5cf4
RUN curl -s https://repo.anaconda.com/miniconda/Miniconda3-$MINICONDA_VERSION-Linux-x86_64.sh -o anaconda.sh && \
echo "${MINICONDA_MD5} anaconda.sh" > anaconda.md5 && \
if [ $(md5sum -c anaconda.md5 | awk '{print $2}') != "OK" ] ; then exit 1; fi && \
mkdir -p /opt && \
sh ./anaconda.sh -b -p /opt/conda && \
rm anaconda.sh anaconda.md5
ENV CONDA_DIR /opt/conda
ENV PATH $CONDA_DIR/bin:$PATH
# Install Node Modules
RUN npm install -g yargs katex # mathjax-node mathjax-node-sre
COPY arxiv_library/compilation/katex.js /usr/local/lib/node_modules/katex/dist/
# Install Python Modules
COPY environment.yml .
RUN source $CONDA_DIR/bin/activate && conda env create -f environment.yml && rm environment.yml
# Create a new user for smooth use in SFB876 Cluster
RUN mkdir -p "/home/${USER}" && \
echo "${USER}:x:${USERID}:${GROUPID}:${USER}:/home/${USER}:/bin/bash" >> /etc/passwd && \
echo "${GROUPNAME}:x:${GROUPID}:${USER}" >> /etc/group && \
chown -R "${USERID}:${GROUPID}" "/home/${USER}"
# Copy Repository into Container
WORKDIR "/home/${USER}"
RUN mkdir arxiv_library
COPY . arxiv_library/
RUN chown -R "${USER}" arxiv_library
USER "${USER}"
# Setup Bash for Anaconda Use
RUN echo "source $CONDA_DIR/bin/activate" >> ~/.bashrc
RUN echo "conda activate arxiv" >> ~/.bashrc
# RUN cd mathjax-node-cli &&
WORKDIR "/home/${USER}/arxiv_library"
CMD ["bash"]