forked from numenta/nupic-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
69 lines (55 loc) · 1.66 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
FROM ubuntu:14.04
MAINTAINER Allan Costa <[email protected]>
# Install dependencies
RUN apt-get update
RUN apt-get install -y \
wget \
git-core \
gcc \
g++ \
cmake \
python \
python2.7 \
python2.7-dev \
zlib1g-dev \
bzip2 \
libyaml-dev \
libyaml-0-2
RUN wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py -O - | python
RUN pip install --upgrade setuptools
RUN pip install wheel
# Use gcc to match nupic.core binary
ENV CC gcc
ENV CXX g++
# Install capnproto from source
RUN wget https://capnproto.org/capnproto-c++-0.5.2.tar.gz && \
tar zxf capnproto-c++-0.5.2.tar.gz && \
cd capnproto-c++-0.5.2 && \
./configure && \
make check && \
make install
# Set enviroment variables needed by NuPIC
ENV NUPIC /usr/local/src/nupic
ENV NTA_DATA_PATH /usr/local/src/nupic/prediction/data
# OPF needs this
ENV USER docker
# Copy context into container file system
ADD . $NUPIC
WORKDIR /usr/local/src
# Clone nupic.core
RUN git clone `head -n 2 $NUPIC/.nupic_modules | tail -n 1 | sed -r "s/NUPIC_CORE_REMOTE = '(.+)'/\\1/"` && \
cd nupic.core && \
git reset --hard `head -n 3 $NUPIC/.nupic_modules | tail -n 1 | sed -r "s/NUPIC_CORE_COMMITISH = '(.+)'/\\1/"`
WORKDIR /usr/local/src/nupic.core
# Build nupic.core
RUN pip install -r bindings/py/requirements.txt && \
mkdir -p build/scripts && \
cd build/scripts && \
cmake ../.. -DCMAKE_INSTALL_PREFIX=/usr/local && \
make install && \
cd ../../bindings/py && \
python setup.py install --nupic-core-dir=/usr/local
WORKDIR /usr/local/src/nupic
# Install NuPIC with using SetupTools
RUN python setup.py install
WORKDIR /home/docker