Skip to content

Commit

Permalink
ARM (aarch64) support + opencv #3
Browse files Browse the repository at this point in the history
  • Loading branch information
rafie committed May 23, 2019
1 parent b29b9a5 commit 748fb16
Showing 1 changed file with 50 additions and 1 deletion.
51 changes: 50 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,55 @@ FROM raffapen/redisgears-arm:arm64-bionic as redisgears
# FROM redislabs/redistimeseries:arm64-bionic as redistimeseries
# FROM redislabs/redisgears:arm64-bionic as redisgears

#----------------------------------------------------------------------------------------------
FROM raffapen/redis-arm:arm64-bionic as opencv

COPY --from=redisgears /opt/redislabs /opt/redislabs

RUN apt-get update; apt-get install -y \
build-essential cmake git wget unzip yasm pkg-config \
libswscale-dev libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libavformat-dev libpq-dev

RUN pip install numpy

WORKDIR /opt

ENV OPENCV_VERSION="4.1.0"

RUN \
wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip ;\
unzip ${OPENCV_VERSION}.zip ;\
mkdir -p opencv-${OPENCV_VERSION}/cmake_binary ;\
cd opencv-${OPENCV_VERSION}/cmake_binary ;\

RUN \
cmake -DBUILD_TIFF=ON \
-D BUILD_opencv_java=OFF \
-D WITH_CUDA=OFF \
-D WITH_OPENGL=ON \
-D WITH_OPENCL=ON \
-D WITH_IPP=ON \
-D WITH_TBB=ON \
-D WITH_EIGEN=ON \
-D WITH_V4L=ON \
-D BUILD_TESTS=OFF \
-D BUILD_PERF_TESTS=OFF \
-D CMAKE_BUILD_TYPE=RELEASE \
\
-D CMAKE_INSTALL_PREFIX=$(python3.7 -c "import sys; print(sys.prefix)") \
-D PYTHON_EXECUTABLE=$(which python3.7) \
-D PYTHON_INCLUDE_DIR=$(python3.7 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-D PYTHON_PACKAGES_PATH=$(python3.7 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D PYTHON_DEFAULT_EXECUTABLE=$(which python3.7) \
-D PYTHON3_NUMPY_INCLUDE_DIRS:PATH=$(python3.7 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/numpy/core/include \
-D PYTHON3_PACKAGES_PATH=$(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") \
-D BUILD_PYTHON_SUPPORT=yes \
-D BUILD_NEW_PYTHON_SUPPORT=yes \
-D PYTHON_LIBRARY=$(python3 -c "from distutils.sysconfig import get_config_var;from os.path import dirname,join ; print(join(dirname(get_config_var('LIBPC')),get_config_var('LDLIBRARY')))") \
..
RUN make -j`nproc`
RUN make install

#----------------------------------------------------------------------------------------------
FROM raffapen/redis-arm:arm64-bionic

Expand All @@ -22,7 +71,7 @@ RUN set -ex;\
COPY --from=redistimeseries ${LD_LIBRARY_PATH}/*.so ${LD_LIBRARY_PATH}/
COPY --from=redisai ${LD_LIBRARY_PATH}/*.so* ${LD_LIBRARY_PATH}/
COPY --from=redisgears /opt/redislabs/lib/modules/redisgears.so ${LD_LIBRARY_PATH}/
COPY --from=redisgears /opt/redislabs /opt/redislabs
COPY --from=opencv /opt/redislabs /opt/redislabs

CMD ["--loadmodule", "/usr/lib/redis/modules/redistimeseries.so", \
"--loadmodule", "/usr/lib/redis/modules/redisai.so", \
Expand Down

0 comments on commit 748fb16

Please sign in to comment.