Ticket #27824: Dockerfile-ubuntu-minimal

File Dockerfile-ubuntu-minimal, 3.8 KB (added by mkoeppe, 2 years ago)
Line 
1# -*- Dockerfile -*-
2# docker build . -f Dockerfile-sagemath-binary -t mkoeppe/sagemath-binary --build-arg http_proxy=http://host.docker.internal:3128
3# FIXME: Clean up setup vs. tester images in the 3 repos.
4ARG BASE_IMAGE=ubuntu:latest
5FROM ${BASE_IMAGE} AS sage-run
6
7# use bsdtar as tar fails sometimes with "Directory renamed before its status could be extracted"
8# This is a known issue with overlayfs: https://github.com/coreos/bugs/issues/1095
9# python is needed for 'relocate-once.py'
10RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes curl bsdtar python && apt-get --yes clean
11## To run sage, additionally need:
12RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
13        libpng-dev libfreetype6 \
14        && apt-get --yes clean
15## To build optional packages, additionally need:
16## (similar to https://doc.sagemath.org/html/en/installation/source.html)
17RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
18        gcc g++ gfortran make m4
19## To build optional package, to avoid installing the following from source, one needs:
20RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
21        patch pkg-config libfreetype6-dev git
22
23## For bootstrapping
24RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
25        gettext autoconf automake libtool
26
27## New: python3.7 and 'Prereqs' of python3
28RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
29        libsqlite3-dev libffi-dev libbz2-dev liblzma-dev python3.7
30
31
32# List from https://doc.sagemath.org/html/en/installation/source.html (sage 9.0)
33RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
34  binutils pixz gcc g++ gfortran make m4 perl tar \
35  git patch openssl libssl-dev libz-dev bc libbz2-dev liblzma-dev libgmp-dev \
36  libffi-dev libgf2x-dev libcurl4-openssl-dev libzmq3-dev curl yasm \
37  pkg-config libntl-dev libmpfr-dev libmpc-dev libflint-dev \
38  libpcre3-dev libgd-dev libflint-dev libflint-arb-dev \
39  libsymmetrica2-dev gmp-ecm libecm-dev libisl-dev libgivaro-dev \
40  libpari-dev pari-gp2c libec-dev liblrcalc-dev \
41  libm4ri-dev libm4rie-dev liblfunction-dev lcalc
42
43# New: From Erik https://trac.sagemath.org/ticket/27824#comment:52
44RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
45 python3-distutils
46
47# New: New spkg-configure.m4 in 9.1.beta0
48RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
49        libopenblas-dev \
50        cliquer libcliquer-dev \
51        tachyon
52
53# Forgotten
54RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
55        libncurses5-dev libmpfi-dev libreadline-dev libgsl-dev
56
57# New: Need python headers
58RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes \
59     libpython3.7-dev
60
61# Bootstrapping
62RUN mkdir -p /sage
63WORKDIR /sage
64ADD Makefile VERSION.txt README.md bootstrap configure.ac sage ./
65ADD m4 ./m4
66ADD build ./build
67ADD src/bin/sage-version.sh src/bin/sage-version.sh
68RUN ./bootstrap
69
70# Configuring
71# TODO: add many force options for every package
72# On ubuntu bionic: --with-system-givaro=force .... checking is givaro's version good enough? ... no. Install givaro
73ADD src/ext src/ext
74ADD src/bin src/bin
75ADD src/Makefile.in src/Makefile.in
76ADD src/sage/env_config.py.in src/sage/env_config.py.in
77RUN ./configure --enable-build-as-root --with-system-python3=force
78
79# Building
80ARG MAKEFLAGS="-j10"
81ENV MAKEFLAGS $MAKEFLAGS
82ARG SAGE_NUM_THREADS="10"
83ENV SAGE_NUM_THREADS $SAGE_NUM_THREADS
84RUN make toolchain V=0
85RUN bash -l -c 'make pynac V=0'
86RUN bash -l -c 'make scipy'
87
88# Building things depending on src/
89COPY ./src ./src
90RUN bash -l -c 'make build V=0'
91RUN bash -l -c 'make V=0'