Dockerfile 1.34 KB
Newer Older
1
FROM phusion/baseimage:0.11
Philipp  Trunschke's avatar
Philipp Trunschke committed
2
3
4
5
USER root
WORKDIR "/tmp/"

# Get Ubuntu updates
6
7
RUN apt-get update && \
    apt-get upgrade -y -o Dpkg::Options::="--force-confold"
Philipp  Trunschke's avatar
Philipp Trunschke committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

# Set locale environment
RUN apt-get -y install locales sudo && \
    echo "C.UTF-8 UTF-8" > /etc/locale.gen && \
    locale-gen
ENV LC_ALL=C.UTF-8 \
    LANG=C.UTF-8 \
    LANGUAGE=C.UTF-8

# Non-Python utilities and libraries
RUN apt-get -y install \
    cmake \
    doxygen \
    g++ \
    gfortran \
    git \
    libboost-filesystem-dev \
    libboost-system-dev \
    libboost-python-dev \
    liblapack* \
    libopenblas-dev \
    libiberty-dev \
    binutils-dev \
31
32
33
34
35
36
    zlib1g-dev \
    libdpkg-perl

# Check Python versions
RUN python  -c'from __future__ import print_function; import sys; version = "{0}.{1}".format(*sys.version_info); print("python2-version:", version)'
RUN python3 -c'import sys; version = "{0}.{1}".format(*sys.version_info); print("python3-version:", version)'
Philipp  Trunschke's avatar
Philipp Trunschke committed
37
38
39
40
41
42

# Install Python2 based environment
RUN apt-get -y install \
    python-dev \
    python-numpy

Philipp  Trunschke's avatar
Philipp Trunschke committed
43
44
45
46
47
# Install Python3 based environment
RUN apt-get -y install \
    python3-dev \
    python3-numpy

Philipp  Trunschke's avatar
Philipp Trunschke committed
48
49
50
51
52
53
54
# Clean apt
RUN apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# Get number of physical cores to use
RUN lscpu | grep '^CPU(s)' | awk '{print $2}' > NCORES
RUN echo $(($(cat NCORES)-1)) > NCORES_1