From 77e72273608387957340abe1f6a1a4608173fed1 Mon Sep 17 00:00:00 2001 From: TJ Borromeo Date: Tue, 22 Sep 2015 21:00:24 -0700 Subject: [PATCH] Dockerfile: Instantiate opencv3 baseline This should assist in making opencv3 and node-opencv work easier. From logs of this build: -- GDAL: NO -- -- Video I/O: -- DC1394 1.x: NO -- DC1394 2.x: YES (ver 2.2.1) -- FFMPEG: YES -- codec: YES (ver 54.35.0) -- format: YES (ver 54.20.4) -- util: YES (ver 52.3.0) -- swscale: YES (ver 2.1.1) -- resample: NO -- gentoo-style: YES -- GStreamer: -- base: YES (ver 0.10.36) -- video: YES (ver 0.10.36) -- app: YES (ver 0.10.36) -- riff: YES (ver 0.10.36) -- pbutils: YES (ver 0.10.36) -- OpenNI: NO -- OpenNI PrimeSensor Modules: NO -- OpenNI2: NO -- PvAPI: NO -- GigEVisionSDK: NO -- UniCap: NO -- UniCap ucil: NO -- V4L/V4L2: Using libv4l1 (ver 1.0.1) / libv4l2 (ver 1.0.1) -- XIMEA: NO -- Xine: NO -- gPhoto2: NO -- -- Other third-party libraries: -- Use IPP: 8.2.1 [8.2.1] -- at: /opencv/opencv-3.0.0/3rdparty/ippicv/unpack/ippicv_lnx -- Use IPP Async: NO -- Use Eigen: NO -- Use TBB: YES (ver 4.2 interface 7000) -- Use OpenMP: NO -- Use GCD NO -- Use Concurrency NO -- Use C=: NO -- Use pthreads for parallel for: -- NO -- Use Cuda: NO -- Use OpenCL: YES -- -- OpenCL: -- Version: dynamic -- Include path: /opencv/opencv-3.0.0/3rdparty/include/opencl/1.2 -- Use AMDFFT: NO -- Use AMDBLAS: NO -- -- Python 2: -- Interpreter: /usr/bin/python2.7 (ver 2.7.6) -- Libraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so (ver 2.7.6) -- numpy: /usr/lib/python2.7/dist-packages/numpy/core/include (ver 1.8.2) -- packages path: lib/python2.7/dist-packages -- -- Python 3: -- Interpreter: /usr/bin/python3.4 (ver 3.4) -- -- Python (for build): /usr/bin/python2.7 -- -- Java: -- ant: NO -- JNI: NO -- Java wrappers: NO -- Java tests: NO -- -- Matlab: -- mex: NO -- -- Documentation: -- Doxygen: NO -- PlantUML: NO -- -- Tests and samples: -- Tests: YES -- Performance tests: YES -- C/C++ Examples: NO -- -- Install path: /usr/local -- -- cvconfig.h is in: /opencv/opencv-3.0.0/build -- ----------------------------------------------------------------- -- -- Configuring done -- Generating done CMake Warning: Manually-specified variables were not used by the project: BUILD_NEW_PYTHON_SUPPORT -- Build files have been written to: /opencv/opencv-3.0.0/build --- Dockerfile | 84 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 930a6df4..f1ef509f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,16 +4,80 @@ # 2) Build: wget https://raw.github.com/dotcloud/docker/v0.1.6/contrib/docker-build/docker-build && python docker-build $USER/node-opencv < Dockerfile # 3) Test: docker run $USER/node-opencv node -e "console.log(require('opencv').version)" # -# VERSION 0.2 +# VERSION 0.3 # DOCKER-VERSION 8.1.2 + # update to 14.04 -from ubuntu:14.04 -run apt-get update -qq -run apt-get install -y software-properties-common python-software-properties -run add-apt-repository -y ppa:kubuntu-ppa/backports -run apt-get update -run apt-get install -y libcv-dev libcvaux-dev libhighgui-dev libopencv-dev -run curl -sL https://deb.nodesource.com/setup | bash - -run apt-get install -y nodejs -run npm install opencv@3.2.0 || cat npm-debug.log +FROM ubuntu:14.04 + +# listing myself as maintainer of _this_ Dockerfile, though I am not the author of the install script (credit to http://rodrigoberriel.com/) +MAINTAINER borromeotlhs@gmail.com + +# run Rodrigo Berriel’s script for installing opencv3 on Ubuntu 14.04 +# I’ll convert this into a full Dockerfile later, once I see if it works +#COPY ./install-opencv3.sh /tmp/ + +# this is needed as libfaac-dev comes from multiverse, according to: +# http://superuser.com/questions/467774/how-to-install-libfaac-dev +RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse\n\ +deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse\n\ +deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse\n\ +deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse\n"\ +>> /etc/apt/sources.list + + +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \ + software-properties-common +RUN add-apt-repository ppa:george-edison55/cmake-3.x +RUN apt-get update -qq +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \ +curl \ +cmake \ +wget \ +unzip \ +libopencv-dev \ +build-essential \ +git \ +libgtk2.0-dev \ +pkg-config \ +python-dev \ +python-numpy \ +libdc1394-22 \ +libdc1394-22-dev \ +libjpeg-dev \ +libpng12-dev \ +libtiff4-dev \ +libjasper-dev \ +libavcodec-dev \ +libavformat-dev \ +libswscale-dev \ +libxine-dev \ +libgstreamer0.10-dev \ +libgstreamer-plugins-base0.10-dev \ +libv4l-dev \ +libtbb-dev \ +libqt4-dev \ +libfaac-dev \ +libmp3lame-dev \ +libopencore-amrnb-dev \ +libopencore-amrwb-dev \ +libtheora-dev \ +libvorbis-dev \ +libxvidcore-dev \ +x264 \ +v4l-utils + +RUN mkdir opencv +WORKDIR opencv + +RUN wget https://github.com/Itseez/opencv/archive/3.0.0.zip -O opencv-3.0.0.zip +RUN unzip opencv-3.0.0.zip +RUN mkdir opencv-3.0.0/build +WORKDIR opencv-3.0.0/build + +RUN cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D WITH_OPENGL=ON .. + +RUN make -j $(nproc) && make install +RUN echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf +RUN ldconfig