This repository has been archived by the owner on May 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
125 lines (90 loc) · 2.95 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
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Docker container for lmh
# (c) The KWARC Group 2015
FROM debian:stable
MAINTAINER Tom Wiesing <tkw01536@gmail.com>
ENV TERM xterm
#
# STEP 1: INSTALL APT-GET PACKAGES
#
RUN echo "Installing apt-get packages" && \
# Pull package lists and upgrade existing packages.
apt-get clean && \
apt-get update && \
apt-get dist-upgrade -y && \
# Install all the required dependencies
apt-get install -y \
bindfs \
cpanminus \
fontconfig \
git \
libgdbm-dev \
liblwp-protocol-https-perl \
libssl-dev \
libxml2-dev \
libxslt-dev \
openjdk-7-jre-headless \
perl \
perlmagick \
python3 \
python3-dev \
python3-pip \
tar \
trang \
wget && \
# Clear apt-get caches to save space
apt-get clean && rm -rf /var/lib/apt/lists/*
#
# STEP 2: Install TexLive + Fonts
#
ADD files/install.profile /root/texlive/install.profile
RUN echo "Installing TexLive 2015" && \
# Create the texlive directory
mkdir -p /root/texlive/ && \
# Grab the setup image
wget -nv -O /root/texlive/texlive.tar.gz http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz && \
# Untar it to /root/texlive
tar -xzf /root/texlive/texlive.tar.gz -C /root/texlive --strip-components=1 && \
# Run the installer
cd /root/texlive && ./install-tl --profile install.profile && \
# Remove /root/textlive and /tmp
rm -rf /root/texlive && \
rm -rf /tmp/*
# Set TexLive paths
ENV INFOPATH /usr/local/texlive/2015/texmf-dist/doc/info:$INFOPATH
ENV INFOPATH /usr/local/texlive/2015/texmf-dist/doc/man:$MANPATH
ENV PATH /usr/local/texlive/2015/bin/x86_64-linux:$PATH
# Add the profile and fonts (for KWARC/localmh#217)
ADD files/FandolFang-Regular.otf /usr/share/fonts/opentype/Fandol/
ADD files/cwTeXQKai-Medium.ttf /usr/share/fonts/truetype/cwTeX/
RUN echo "Updating TexLive Settings and fonts" && \
# Re-generate font cache
fc-cache && \
# set special sTeX parameters
echo "max_in_open = 50\nparam_size = 20000\nnest_size = 1000\nstack_size = 10000\n" >> $(kpsewhich texmf.cnf)
#
# STEP 3: Make some directories
#
RUN echo "Creating directories ..." && \
mkdir -p /path/to/home && chmod a+rw /path/to/home/ && \
mkdir -p /path/to/home/.ssh && chmod a+rw /path/to/home/.ssh && \
mkdir -p /path/to/localmh/ && chmod a+rw /path/to/localmh/
#
# STEP 4: Pull lmh and install.
#
ADD files/lmh /usr/local/bin/lmh
RUN echo "Installing lmh" && \
# Clone it from github
git clone https://github.com/KWARC/localmh /path/to/localmh && \
# Install pip dependencies (without cache)
pip3 install lxml psutil pyapi-gitlab && \
# Remove the python cache
rm -rf /root/.pip/cache/ && \
# Make the MathHub directory
mkdir -p /path/to/localmh/MathHub && \
# Run the setup process
lmh setup --install all
# STEP 4: FINAL SETUP
#
ADD files/localmh_init /sbin/localmh_init
ADD files/sshag.sh /path/to/home/sshag.sh
CMD ["/sbin/localmh_init"]