-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathDockerfile
91 lines (80 loc) · 1.98 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
FROM ubuntu:18.04 as packages
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y \
cmake \
g++ \
gfortran \
git \
libblas-dev \
libfreetype6-dev \
libgsl0-dev \
libjpeg8-dev \
liblapack-dev \
libncurses5-dev \
libopenmpi-dev \
libpng++-dev \
libreadline-dev \
openmpi-bin \
python-dev \
python-nose \
python-pip \
python-tk \
subversion \
zlib1g-dev \
wget
WORKDIR /source
COPY requirements.txt ./
RUN pip install --upgrade distribute \
&& pip install -r requirements.txt
RUN git clone https://github.com/antolikjan/imagen.git \
&& cd imagen \
&& python setup.py install
RUN wget https://github.com/nest/nest-simulator/archive/v2.20.0.tar.gz \
&& tar xvfz v2.20.0.tar.gz \
&& cd nest-simulator-2.20.0 \
&& cmake \
-Dwith-mpi=OFF \
-Dwith-boost=ON \
-DCMAKE_INSTALL_PREFIX:PATH=/opt/nest \
-Dwith-optimize='-O3' \
./ \
&& make \
&& make install
WORKDIR /source/mozaik
COPY mozaik ./mozaik
COPY setup.py README.rst ./
RUN python setup.py install
FROM ubuntu:18.04 as prod
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libfreetype6 \
libgomp1 \
libgsl23 \
libjpeg8 \
libncurses5 \
libpython2.7 \
openmpi-bin \
python-nose \
python-six \
python-tk \
python2.7 \
ssh \
&& rm -rf /var/lib/apt/lists/*
ARG PACKAGES_DIR=/usr/local/lib/python2.7/dist-packages
COPY --from=packages $PACKAGES_DIR $PACKAGES_DIR
COPY --from=packages /opt/nest /opt/nest
ENV PYTHONPATH=/opt/nest/lib/python2.7/site-packages
RUN groupadd -g 1000 mozaik \
&& useradd -m -u 1000 -g mozaik mozaik
USER mozaik
WORKDIR /app
ENTRYPOINT ["python"]
FROM prod as dev
USER root
RUN apt-get update \
&& apt-get install -y \
python-pip \
&& pip install pytest
USER mozaik
ENTRYPOINT [""]