DockerFile
For this container we are going to use a Ubuntu:16.04 as a base image.
FROM ubuntu:16.04
MAINTAINER Alfredo Reyes "reyes-fred@hotmail.com"In this part of the dockerfile we need to specify the package that we want to download.
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y sudo build-essential cmake pkg-config libjpeg8-dev \
libtiff5-dev libjasper-dev libpng12-dev libavcodec-dev libavformat-dev \
libswscale-dev libv4l-dev libxvidcore-dev libx264-dev \
libatlas-base-dev gfortran wget unzip python-dev python-numpy \
libtbb2 libtbb-dev libjpeg-dev libpng-dev libjasper-dev libdc1394-22-dev \
libgtk-3-dev python2.7-dev python3.5-dev git python-pip python3-pip python3-testresources \
libcanberra-gtk-moduleWe need to install also python to execute files.
RUN python -m pip install --upgrade pip && pip3 install numpyWe download opencv and opencv_contrib that are extra modules. In this case we are getting version 3.4.2 , fill free to change for the most recently version that is on github. We download as a zip both package and the unzip them.
RUN wget -O opencv3.zip https://github.com/Itseez/opencv/archive/3.4.2.zip && \
unzip -q opencv3.zip && mv /opencv-3.4.2 /opencv
RUN wget -O opencv_contrib3.zip https://github.com/Itseez/opencv_contrib/archive/3.4.2.zip && \
unzip -q opencv_contrib3.zip && mv /opencv_contrib-3.4.2 /opencv_contribWe need to create a build folder under the opencv files, so we could compile them. We first execute the cmake with that parameters and then make instruction.
*make -j4, 4 could be replace with the number of process that you have in your machine.
Lets remove the files that we have download so the image could be more lighter.
Finally we need to clone the Xiaomin repository and execute the setup.sh to install all the dependencies.
Last updated
Was this helpful?