Dockerfile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. RUN apt-get install -y python-numpy python-scipy
  33. # Configure jupyter
  34. # we run this manually after mounting /root/.jupyter
  35. # RUN jupyter notebook --generate-config
  36. # RUN mkdir notebooks
  37. # RUN sed -i "/c.NotebookApp.open_browser/c c.NotebookApp.open_browser = False" /root/.jupyter/jupyter_notebook_config.py \
  38. # && sed -i "/c.NotebookApp.ip/c c.NotebookApp.ip = '*'" /root/.jupyter/jupyter_notebook_config.py \
  39. # && sed -i "/c.NotebookApp.notebook_dir/c c.NotebookApp.notebook_dir = '/root/notebooks'" /root/.jupyter/jupyter_notebook_config.py
  40. # change to letscode.00
  41. # sudo vi /opt/fast/jupyter/config_root/jupyter_notebook_config.py
  42. VOLUME /root/notebooks
  43. EXPOSE 8888
  44. CMD ["jupyter", "notebook", "--allow-root"]
  45. HEALTHCHECK --interval=10s CMD curl -sS --fail http://localhost:8888 || exit 1
  46. # python-pip
  47. # install ipython2 kernel into jupyter
  48. # RUN pip install --upgrade pip
  49. # RUN python2 -m pip install ipykernel
  50. # RUN python2 -m ipykernel install --user
  51. # this version will be used by matrix python bindings
  52. RUN pyversions -d
  53. RUN git clone https://github.com/hzeller/rpi-rgb-led-matrix.git /matrix
  54. WORKDIR /matrix
  55. RUN sed -i "s/=regular/=adafruit-hat-pwm/g" lib/Makefile
  56. # for C++-demos
  57. RUN make -C examples-api-use
  58. # for python interface
  59. RUN cd bindings/python && make build-python install-python
  60. COPY *.py /
  61. # CMD python -u /pixelreceiver.py > /pixel/receive.log & jupyter notebook --allow-root
  62. CMD jupyter notebook --allow-root