Created
August 30, 2020 20:58
-
-
Save shal/336caed377e9ee4c9c7ac21d36bb638f to your computer and use it in GitHub Desktop.
Dockefile OpenCV 4.4.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3.12 | |
ENV OPENCV_VERSION=4.4.0 | |
ARG LD_LIBRARY_PATH=/usr/local/lib | |
ARG MAKEFLAGS="-j2" | |
ARG PKG_CONFIG_PATH="/usr/local/share/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig" | |
ARG PREFIX=/usr/local | |
ARG LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64:/usr/lib64:/usr/lib:/lib64:/lib" | |
RUN buildDeps="tiff zlib libpng libjpeg \ | |
tiff-dev zlib-dev libpng-dev jpeg-dev \ | |
autoconf \ | |
m4 \ | |
linux-headers \ | |
build-base \ | |
gcc \ | |
make \ | |
cmake \ | |
pkgconfig \ | |
automake \ | |
ca-certificates \ | |
g++ \ | |
curl \ | |
git \ | |
curl-dev \ | |
libtool" && \ | |
apk update && apk upgrade&& \ | |
apk add --no-cache ${buildDeps} | |
RUN DIR=/tmp/opencv && \ | |
mkdir -p ${DIR} && \ | |
cd ${DIR} && \ | |
curl -sL https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.tar.gz | \ | |
tar -zx --strip-components=1 && \ | |
mkdir -p ${DIR}/build && \ | |
cd ${DIR}/build && \ | |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PREFIX} .. && \ | |
make && \ | |
make install && \ | |
rm -rf ${DIR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment