1- FROM resin /raspberrypi3-python:2.7
2- # This image is base on the resin image for building Python apps on Raspberry Pi 3.
1+ FROM balenalib /raspberrypi3
2+ # The balena base image for building apps on Raspberry Pi 3.
33
4- # Enforces cross-compilation through Quemu
5- RUN [ "cross-build-start" ]
6-
7- # update list of packages available
8- RUN apt-get update && apt-get install -y libboost-python1.55.0
4+ RUN echo "BUILD MODULE: CameraCapture"
95
10- # Install python packages
11- COPY /build/arm32v7-requirements.txt ./
12- RUN pip install --upgrade pip && pip install --upgrade setuptools && pip install -r arm32v7-requirements.txt
6+ # Enforces cross-compilation through Quemu
7+ RUN [ "cross-build-start" ]
138
14- # Install build modules for openCV
15- # Based on the work at https://github.com/mohaseeb/raspberrypi3-opencv-docker
16- RUN sudo apt-get install -y --no-install-recommends \
17- # to build and install opencv
18- unzip \
19- build-essential cmake pkg-config \
20- # to work with image files
9+ # Update package index and install dependencies
10+ RUN install_packages \
11+ python3 \
12+ python3-pip \
13+ python3-dev \
14+ build-essential \
15+ libopenjp2-7-dev \
16+ zlib1g-dev \
17+ libatlas-base-dev \
18+ wget \
19+ libboost-python1.62.0 \
20+ curl \
21+ libcurl4-openssl-dev
22+
23+ # Required for OpenCV
24+ RUN install_packages \
25+ # Hierarchical Data Format
26+ libhdf5-dev libhdf5-serial-dev \
27+ # for image files
2128 libjpeg-dev libtiff5-dev libjasper-dev libpng-dev \
22- # to work with video files
29+ # for video files
2330 libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
24- # to display GUI
25- libgtk2.0-dev pkg-config \
26- && sudo rm -rf /var/lib/apt/lists/* \
27- && sudo apt-get -y autoremove
31+ # for GUI
32+ libqt4-test libqtgui4 libqtwebkit4 libgtk2.0-dev \
33+ # high def image processing
34+ libilmbase-dev libopenexr-dev
2835
29- RUN OPENCV_VERSION=3.4.2 \
30- && WS_DIR=`pwd` \
31- && mkdir opencv \
32- && cd opencv \
33- # download OpenCV and opencv_contrib
34- && wget -O opencv.zip https://github.com/opencv/opencv/archive/$OPENCV_VERSION.zip \
35- && unzip opencv.zip \
36- && sudo rm -rf opencv.zip \
37- && OPENCV_SRC_DIR=`pwd`/opencv-$OPENCV_VERSION \
38- # build and install without gpu dependency
39- && cd $OPENCV_SRC_DIR \
40- && mkdir build && cd build \
41- && cmake -D CMAKE_BUILD_TYPE=RELEASE \
42- -D CMAKE_INSTALL_PREFIX=/usr/local \
43- -D ENABLE_FAST_MATH=1 \
44- -D CUDA_FAST_MATH=1 \
45- -D WITH_OPENCL=off -D WITH_OPENCL_SVM=off \
46- -D WITH_OPENCLAMDFFT=off \
47- -D WITH_OPENCLAMDBLAS=off \
48- -D OPENCV_EXTRA_MODULES_PATH=$OPENCV_CONTRIB_MODULES_SRC_DIR \
49- -D BUILD_opencv_gpu=off \
50- .. \
51- && make \
52- && sudo make install \
53- # cleanup
54- && cd $WS_DIR \
55- && sudo rm -rf opencv
36+ # Install Python packages
37+ COPY /build/arm32v7-requirements.txt ./
38+ RUN pip3 install --upgrade pip
39+ RUN pip3 install --upgrade setuptools
40+ RUN pip3 install --index-url=https://www.piwheels.org/simple -r arm32v7-requirements.txt
5641
57- RUN pip install trollius tornado
42+ # Cleanup
43+ RUN rm -rf /var/lib/apt/lists/* \
44+ && apt-get -y autoremove
5845
5946RUN [ "cross-build-end" ]
6047
@@ -64,4 +51,4 @@ ADD /test/ .
6451# Expose the port
6552EXPOSE 5012
6653
67- ENTRYPOINT [ "python " , "-u" , "./main.py" ]
54+ ENTRYPOINT [ "python3 " , "-u" , "./main.py" ]
0 commit comments