forked from gap-system/gap-docker-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
206 lines (185 loc) · 7.02 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
FROM ubuntu:latest
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
# never install suggests or recommends to make the image smaller
RUN echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf
RUN echo 'APT::Install-Recommends "0";' >> /etc/apt/apt.conf
# Prerequisites
RUN dpkg --add-architecture i386 \
&& apt-get update -qq \
&& apt-get -qq install -y \
autoconf \
autogen \
automake \
build-essential \
cmake \
curl \
g++ \
gcc \
#gcc-multilib \
git \
#libboost-dev \
libcdd-dev \
libcurl4-openssl-dev \
#libflint-dev \
#libglpk-dev \
libgmp-dev \
libgmpxx4ldbl \
libmpc-dev \
libmpfi-dev \
libmpfr-dev \
libncurses5-dev \
#libntl-dev \
libreadline6-dev \
libtool \
#libxml2-dev \
#libzmq3-dev \
m4 \
#mercurial \
#polymake \
#python3-pip \
sudo \
unzip \
wget \
texlive-latex-extra \
texlive-fonts-extra \
texlive-science \
python-is-python3 \
vim \
gnupg \
ca-certificates \
zlib1g-dev \
4ti2 \
singular \
libnormaliz-dev \
zip \
time \
jupyter-notebook \
jupyter-nbconvert \
# needed for getprotobyname used in IO_socket in IO, used for SingleHTTPRequest
netbase \
bash-completion \
&& ln -fs /usr/share/zoneinfo/Europe/Berlin /etc/localtime
RUN curl -L https://download.arangodb.com/arangodb312/DEBIAN/Release.key | gpg --dearmor > /etc/apt/trusted.gpg.d/arangodb.gpg \
&& echo 'deb https://download.arangodb.com/arangodb312/DEBIAN/ /' > /etc/apt/sources.list.d/arangodb.list \
&& apt-get update \
&& apt-get install arangodb3-client
#RUN pip3 install notebook jupyterlab_launcher jupyterlab traitlets ipython vdom
# add gap user, use uid and gid used by GitHub Actions
RUN addgroup --quiet --gid 121 gap \
&& adduser --quiet --shell /bin/bash --gecos "GAP user,101,," --disabled-password --uid 1001 --gid 121 gap \
&& adduser gap sudo \
&& chown -R gap:gap /home/gap/ \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& cd /home/gap \
&& touch .sudo_as_admin_successful
## CXSC (for Float)
#ENV CXSC_VERSION 2-5-4
#RUN cd /tmp \
# && wget http://www2.math.uni-wuppertal.de/wrswt/xsc/cxsc/cxsc-${CXSC_VERSION}.tar.gz \
# && tar -xf cxsc-${CXSC_VERSION}.tar.gz \
# && mkdir cxscbuild \
# && cd cxscbuild \
# && cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/cxsc /tmp/cxsc-${CXSC_VERSION} \
# && make \
# && make install
#
## libfplll (for Float)
#ENV FPLLL_VERSION 5.2.1
#RUN cd /tmp \
# && wget https://github.com/fplll/fplll/releases/download/${FPLLL_VERSION}/fplll-${FPLLL_VERSION}.tar.gz \
# && tar -xf fplll-${FPLLL_VERSION}.tar.gz \
# && rm fplll-${FPLLL_VERSION}.tar.gz \
# && cd fplll-${FPLLL_VERSION} \
# && ./configure \
# && make \
# && make install \
# && cd /tmp \
# && rm -rf fplll-${FPLLL_VERSION}
#
#
## flint (for Singular)
## RUN cd /tmp \
## && git clone https://github.com/wbhart/flint2.git \
## && cd flint2 \
## && ./configure \
## && make -j4 \
## && make install \
## && cd /tmp \
## && rm -rf flint2
#
## Singular
#ENV SINGULAR_VERSION 4.1.2
#ENV SINGULAR_PATCH p1
#RUN cd /opt \
# && wget http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/$(echo ${SINGULAR_VERSION} | tr . -)/singular-${SINGULAR_VERSION}${SINGULAR_PATCH}.tar.gz \
# && tar -xf singular-${SINGULAR_VERSION}${SINGULAR_PATCH}.tar.gz \
# && rm singular-${SINGULAR_VERSION}${SINGULAR_PATCH}.tar.gz \
# && chown -hR gap singular-${SINGULAR_VERSION} \
# && cd singular-${SINGULAR_VERSION} \
# && ./configure \
# && make -j4 \
# && make install
#
## 4ti2
#ENV _4TI2_VERSION 1_6_9
#RUN cd /opt \
# && wget https://github.com/4ti2/4ti2/archive/Release_${_4TI2_VERSION}.tar.gz \
# && tar -xf Release_${_4TI2_VERSION}.tar.gz \
# && chown -hR gap 4ti2-Release_${_4TI2_VERSION} \
# && rm Release_${_4TI2_VERSION}.tar.gz \
# && cd 4ti2-Release_${_4TI2_VERSION} \
# && chmod +x autogen.sh \
# && ./autogen.sh \
# && ./configure \
# && touch doc/4ti2_manual.pdf \
# && make -j4 \
# && make install
#
## Pari/GP
#ENV PARI_VERSION 2.9.5
#RUN cd /tmp/ \
# # the https version uses a certificate not trusted by wget
# && wget http://pari.math.u-bordeaux.fr/pub/pari/OLD/2.9/pari-${PARI_VERSION}.tar.gz \
# && tar -xf pari-${PARI_VERSION}.tar.gz \
# && rm pari-${PARI_VERSION}.tar.gz \
# && cd pari-${PARI_VERSION} \
# && ./Configure \
# && make install
#
## Macaulay2
#RUN . /etc/lsb-release \
# && echo "deb http://www.math.uiuc.edu/Macaulay2/Repositories/Ubuntu focal main" >/etc/apt/sources.list.d/macaulay2.list \
# && wget http://www2.macaulay2.com/Macaulay2/PublicKeys/Macaulay2-key \
# && apt-key add Macaulay2-key \
# && apt-get update -qq \
# && apt-get -qq install -y macaulay2
#RUN rm -r /tmp/*
#ENV LD_LIBRARY_PATH /usr/local/lib:${LD_LIBRARY_PATH}
# /usr/lib/git-core/git-subtree: use bash instead of sh (= dash)
# /usr/lib/git-core/git-subtree fails with "Maximum function recursion depth (1000) reached" for large projects when using dash in Debian/Ubuntu
RUN sed 's|#!/bin/sh|#!/bin/bash|' -i /usr/lib/git-core/git-subtree
# Set up new user and home directory in environment.
USER gap
ENV HOME /home/gap
# Note that WORKDIR will not expand environment variables in docker versions < 1.3.1.
# See docker issue 2637: https://github.com/docker/docker/issues/2637
# Start at $HOME.
WORKDIR /home/gap
# create GAP user root
RUN mkdir -p .gap/pkg
RUN mkdir -p inst/julia-master && curl -L https://julialangnightlies-s3.julialang.org/bin/linux/x64/julia-latest-linux64.tar.gz | tar -xvz --strip-components=1 -C inst/julia-master
ENV PATH /home/gap/inst/julia-master/bin:${PATH}
COPY clean_gap_packages.sh /home/gap/clean_gap_packages.sh
# clone GAP.jl and CapAndHomalg.jl
RUN mkdir -p .julia/dev
RUN git clone https://github.com/oscar-system/GAP.jl .julia/dev/GAP
RUN git clone https://github.com/homalg-project/CapAndHomalg.jl .julia/dev/CapAndHomalg
# ignore compatibility of CapAndHomalg with GAP
RUN sed -i '/GAP = "0.7/d' .julia/dev/CapAndHomalg/Project.toml
# installation and cleaning has to happen in the some step or we will not get any saving due to the layering system
# use CPU target "generic" to avoid recompilation on different x86_64 CPUs
# Pkg.develop of a cloned pacakge does not trigger Pkg.build (see: https://github.com/JuliaLang/Pkg.jl/issues/4068)
RUN julia --cpu-target "generic" -e 'using Pkg; Pkg.add("IJulia"); Pkg.develop("GAP"); Pkg.build("GAP"); Pkg.develop("CapAndHomalg"); Pkg.build("CapAndHomalg");'; bash clean_gap_packages.sh
# Start from a BASH shell.
CMD ["bash"]