diff --git a/Dockerfile b/Dockerfile index ecc890a..d97c122 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,6 @@ FROM python:3.6.1-alpine MAINTAINER Alexis Kofman ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" \ - CC="/usr/bin/clang" \ - CXX="/usr/bin/clang++" \ SRC="/usr/local" \ OPENCV_VERSION="3.2.0" \ FFMPEG_VERSION="3.3.2" \ @@ -28,21 +26,20 @@ ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" \ FREETYPE_SHA256SUM="5d03dd76c2171a7601e9ce10551d52d4471cf92cd205948e60289251daddffa8 freetype-2.5.5.tar.gz" \ LIBVIDSTAB_SHA256SUM="14d2a053e56edad4f397be0cb3ef8eb1ec3150404ce99a426c4eb641861dc0bb v1.1.0.tar.gz" +## INSTALL FFMPEG https://ffmpeg.org + RUN apk update && apk upgrade && \ buildDeps="autoconf \ automake \ bash \ binutils \ bzip2 \ - clang \ - clang-dev \ cmake \ curl \ coreutils \ g++ \ gcc \ libtool \ - linux-headers \ make \ openssl-dev \ tar \ @@ -182,7 +179,7 @@ RUN apk update && apk upgrade && \ make install && \ rm -rf ${DIR} && \ #RUN \ -## ffmpeg https://ffmpeg.org +## ffmpeg DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ tar -zx --strip-components=1 -f ffmpeg-${FFMPEG_VERSION}.tar.gz && \ @@ -225,18 +222,26 @@ RUN apk update && apk upgrade && \ make qt-faststart && \ cp qt-faststart ${SRC}/bin && \ rm -rf ${DIR} && \ -#RUN \ -# OpenCV depends on Numpy. It represents images as NumPy arrays, so we need to install NumPy : + +## INSTALL OPENCV http://opencv.org + +#RUN \ + opencvDeps="clang \ + clang-dev \ + linux-headers" && \ + apk add --update ${opencvDeps} && \ + export CC="/usr/bin/clang" && \ + export CXX="/usr/bin/clang++" && \ + # OpenCV depends on NumPy. It represents images as NumPy arrays, so we need to install NumPy pip3 install numpy && \ - ldconfig && \ -#RUN \ -# opencv http://opencv.org +#RUN \ +## opencv DIR=$(mktemp -d) && cd ${DIR} && \ curl -sLO https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.tar.gz && \ tar xzvf ${OPENCV_VERSION}.tar.gz && \ cd opencv-${OPENCV_VERSION} && \ - mkdir build && \ - cd build && \ + mkdir build && cd build && \ + export MAKEFLAGS="-j$(($(grep -c ^processor /proc/cpuinfo) + 1))" && \ cmake -D BUILD_opencv_python3=ON \ -D CMAKE_BUILD_TYPE=RELEASE \ -D INSTALL_C_EXAMPLES=OFF \ @@ -248,8 +253,10 @@ RUN apk update && apk upgrade && \ cp ${DIR}/opencv-${OPENCV_VERSION}/build/lib/python3/cv2.cpython-36m-x86_64-linux-gnu.so /usr/local/lib/python3.6/cv2.so && \ rm -rf ${DIR} && \ -# cleanup +## CLEANUP + cd && \ apk del ${buildDeps} && \ + apk del ${opencvDeps} && \ rm -rf /var/cache/apk/* /usr/local/include && \ ffmpeg -buildconf diff --git a/README.md b/README.md index e0a4dab..515af7f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![ffmpeg](https://img.shields.io/badge/ffmpeg-v3.3.2-blue.svg)](https://ffmpeg.org) [![ffmpeg](https://img.shields.io/badge/opencv-v3.2.0-blue.svg)](http://opencv.org) -Provides a small Docker image (~100MB) intended for video processing. +Provides a Docker image intended for video processing. It includes: - [Python](https://www.python.org) @@ -16,12 +16,12 @@ FFMPEG and OpenCV are compiled from sources. ## Installation ``` -$ docker pull akofman/video-processing:latest +$ docker pull alexiskofman/video-processing:latest ``` Then enjoy what's inside: ``` -$ docker run --rm -ti akofman/video-processing:latest ash +$ docker run --rm -ti alexiskofman/video-processing:latest ash ``` # License