opencv-python

Форк
0
/
Dockerfile_i686 
111 строк · 4.8 Кб
1
FROM quay.io/pypa/manylinux1_i686:latest
2

3
RUN curl -O -L https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz && \
4
    tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz && \
5
    cd qt-everywhere* && \
6
    #configure does a bootstrap make under the hood
7
    #manylinux1 is too old to have `nproc`
8
    export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \
9
    #OpenCV only links against QtCore, QtGui, QtTest
10
    ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license -make && \
11
    make && \
12
    make install && \
13
    cd .. && \
14
    rm -rf qt-everywhere-opensource-src-4.8.7 && \
15
    rm qt-everywhere-opensource-src-4.8.7.tar.gz
16

17
ENV QTDIR /opt/Qt4.8.7
18
ENV PATH "$QTDIR/bin:$PATH"
19

20
RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \
21
    tar -xf cmake-3.9.0.tar.gz && \
22
    cd cmake-3.9.0 && \
23
    #manylinux1 provides curl-devel equivalent and libcurl statically linked
24
    # against the same newer OpenSSL as other source-built tools
25
    # (1.0.2s as of this writing)
26
    yum -y install zlib-devel && \
27
    #configure does a bootstrap make under the hood
28
    export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \
29
    ./configure --system-curl && \
30
    make && \
31
    make install && \
32
    cd .. && \
33
    rm -rf cmake-3.9.0*
34

35
# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies
36
# manylinux provides the toolchain and git; we provide cmake
37
RUN yum install freetype-devel bzip2-devel zlib-devel -y && \
38
    mkdir ~/ffmpeg_sources
39

40
# Newer openssl configure requires newer perl
41
RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.20.1.tar.gz && \
42
    tar -xf perl-5.20.1.tar.gz && \
43
    cd perl-5.20.1 && \
44
    ./Configure -des -Dprefix="$HOME/openssl_build" && \
45
    #perl build scripts do much redundant work
46
    # if running "make install" separately
47
    make install -j$(getconf _NPROCESSORS_ONLN) && \
48
    cd .. && \
49
    rm -rf perl-5.20.1*
50

51
RUN cd ~/ffmpeg_sources && \
52
    curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \
53
    tar -xf OpenSSL_1_1_1c.tar.gz && \
54
    cd openssl-OpenSSL_1_1_1c && \
55
    #in i686, ./config detects x64 in i686 container without linux32
56
    # when run from "docker build"
57
    PERL="$HOME/openssl_build/bin/perl" linux32 ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \
58
    make -j$(getconf _NPROCESSORS_ONLN) && \
59
    #skip installing documentation
60
    make install_sw && \
61
    rm -rf ~/openssl_build
62

63
RUN cd ~/ffmpeg_sources && \
64
    curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \
65
    tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \
66
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
67
    make -j$(getconf _NPROCESSORS_ONLN) && \
68
    make install
69

70
RUN cd ~/ffmpeg_sources && \
71
    curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
72
    tar -xf yasm-1.3.0.tar.gz && \
73
    cd yasm-1.3.0 && \
74
    ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
75
    make -j$(getconf _NPROCESSORS_ONLN) && \
76
    make install
77

78
RUN cd ~/ffmpeg_sources && \
79
    git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
80
    cd libvpx && \
81
    ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
82
    make -j$(getconf _NPROCESSORS_ONLN) && \
83
    make install
84

85
RUN cd ~/ffmpeg_sources && \
86
    curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
87
    tar -xf ffmpeg-snapshot.tar.bz2 && \
88
    cd ffmpeg && \
89
    PATH=~/bin:$PATH && \
90
    PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
91
    make -j$(getconf _NPROCESSORS_ONLN) && \
92
    make install && \
93
    echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
94
    ldconfig && \
95
    rm -rf ~/ffmpeg_sources
96

97
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
98
ENV LDFLAGS -L/root/ffmpeg_build/lib
99

100
RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \
101
    curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \
102
    curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \
103
    curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \
104
    mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux
105

106
#in i686, yum metadata ends up with slightly wrong timestamps
107
#which inhibits its update
108
#https://github.com/skvark/opencv-python/issues/148
109
RUN yum clean all
110

111
ENV PATH "$HOME/bin:$PATH"
112

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.