Skip to content

Instantly share code, notes, and snippets.

@paulscode
Last active September 19, 2018 05:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulscode/0aba5c77de70f712a1afcc9c71baba08 to your computer and use it in GitHub Desktop.
Save paulscode/0aba5c77de70f712a1afcc9c71baba08 to your computer and use it in GitHub Desktop.
Dockerfile to build NuPIC 1.0.5 on Raspberry Pi
FROM armhf/debian:jessie
# To build on Intel processor (much faster!)
# sudo apt install -y qemu qemu-user-static qemu-user binfmt-support
# cp /usr/bin/qemu-arm-static ./
# docker run --rm --privileged multiarch/qemu-user-static:register --reset
# Comment below line if building on the Raspberry Pi itself
COPY ./qemu-arm-static /usr/bin/qemu-arm-static
RUN apt-get update && \
apt-get install -y \
curl \
git-core \
gcc \
g++ \
python \
python2.7 \
python2.7-dev \
zlib1g-dev \
bzip2 \
libyaml-dev \
libyaml-0-2 \
python-pip
RUN echo "deb http://ftp.debian.org/debian jessie-backports main" >> /etc/apt/sources.list
RUN apt-get update && \
apt-get -t jessie-backports install -y --no-install-recommends cmake && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade setuptools wheel RPi.GPIO && \
pip install pycapnp==0.6.3
RUN groupadd -r -g 1000 pi && \
useradd --no-log-init -r -u 1000 -g pi pi && \
mkdir -p /home/pi
WORKDIR /home/pi
RUN git clone -b 1.0.6 https://github.com/numenta/nupic.core.git && \
mkdir -p /home/pi/nupic.core/build/scripts
WORKDIR /home/pi/nupic.core
RUN pip install -r bindings/py/requirements.txt
WORKDIR /home/pi/nupic.core/build/scripts
ENV CC=gcc CXX=g++ USER=root
RUN cmake /home/pi/nupic.core -DCMAKE_BUILD_TYPE=Release -DPY_EXTENSIONS_DIR=/home/pi/nupic.core/bindings/py/src/nupic/bindings
RUN make -j3 && \
make install
WORKDIR /home/pi/nupic.core
RUN python setup.py develop
RUN pip install nupic==1.0.5
WORKDIR /home/pi
RUN git clone -b 1.0.5 https://github.com/numenta/nupic.git && \
chown -R pi:pi /home/pi
USER pi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment