Dockerfile 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. FROM resin/rpi-raspbian:jessie-20170531
  2. # Set the variables
  3. ENV DEBIAN_FRONTEND noninteractive
  4. WORKDIR /root
  5. # Install packages necessary for compiling python
  6. RUN apt-get update && apt-get install -y \
  7. build-essential \
  8. libncursesw5-dev \
  9. libgdbm-dev \
  10. libc6-dev \
  11. zlib1g-dev \
  12. libsqlite3-dev \
  13. tk-dev \
  14. libssl-dev \
  15. openssl \
  16. curl \
  17. vim \
  18. git \
  19. mc \
  20. htop \
  21. python \
  22. python-dev \
  23. python-pip \
  24. libncurses5-dev \
  25. python-pillow
  26. RUN sudo echo "Europe/Berlin" > /etc/timezone
  27. RUN sudo dpkg-reconfigure -f noninteractive tzdata
  28. # Update pip and install jupyter
  29. RUN pip install --upgrade pip
  30. RUN pip install readline notebook==5.2.0 ipywidgets path.py requests cython
  31. RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension
  32. # Configure jupyter
  33. # we run this manually after mounting /root/.jupyter
  34. # RUN jupyter notebook --generate-config
  35. # RUN mkdir notebooks
  36. # RUN sed -i "/c.NotebookApp.open_browser/c c.NotebookApp.open_browser = False" /root/.jupyter/jupyter_notebook_config.py \
  37. # && sed -i "/c.NotebookApp.ip/c c.NotebookApp.ip = '*'" /root/.jupyter/jupyter_notebook_config.py \
  38. # && sed -i "/c.NotebookApp.notebook_dir/c c.NotebookApp.notebook_dir = '/root/notebooks'" /root/.jupyter/jupyter_notebook_config.py
  39. # change to letscode.00
  40. # sudo vi /opt/fast/jupyter/config_root/jupyter_notebook_config.py
  41. VOLUME /root/notebooks
  42. EXPOSE 8888
  43. CMD ["jupyter", "notebook", "--allow-root"]
  44. HEALTHCHECK --interval=10s CMD curl -sS --fail http://localhost:8888 || exit 1
  45. # python-pip
  46. # install ipython2 kernel into jupyter
  47. # RUN pip install --upgrade pip
  48. # RUN python2 -m pip install ipykernel
  49. # RUN python2 -m ipykernel install --user
  50. # this version will be used by matrix python bindings
  51. RUN pyversions -d
  52. RUN git clone https://github.com/hzeller/rpi-rgb-led-matrix.git /matrix
  53. WORKDIR /matrix
  54. RUN sed -i "s/=regular/=adafruit-hat-pwm/g" lib/Makefile
  55. # for C++-demos
  56. RUN make -C examples-api-use
  57. # for python interface
  58. RUN cd bindings/python && make build-python install-python
  59. COPY pixelreceiver.py /
  60. CMD python -u /pixelreceiver.py > /pixel/receive.log & jupyter notebook --allow-root