8000 add dockerfiles and readme · lineCode/opencv-python@6dbdf95 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6dbdf95

Browse files
committed
add dockerfiles and readme
1 parent 07c9d59 commit 6dbdf95

File tree

3 files changed

+189
-0
lines changed

3 files changed

+189
-0
lines changed

docker/Dockerfile_i686

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM quay.io/pypa/manylinux1_i686:latest
2+
3+
RUN wget --no-check-certificate https://download.qt.io/official_releases/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 -prefix /opt/Qt4.8.7 -release -opensource -confirm-license && \
7+
gmake && \
8+
gmake install && \
9+
cd .. && \
10+
rm -rf qt-everywhere-opensource-src-4.8.7 && \
11+
rm qt-everywhere-opensource-src-4.8.7.tar.gz
12+
13+
ENV QTDIR /opt/Qt4.8.7
14+
ENV PATH "$QTDIR/bin:$PATH"
15+
16+
RUN wget --no-check-certificate https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \
17+
tar -zxf cmake-3.9.0.tar.gz && \
18+
cd cmake-3.9.0 && \
19+
yum -y install curl-devel zlib-devel && \
20+
./configure --system-curl && \
21+
make && \
22+
make install && \
23+
cd .. && \
24+
rm -rf cmake-3.9.0*
25+
26+
RUN yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ libtool make mercurial pkgconfig zlib-devel -y && \
27+
yum remove nasm -y && \
28+
mkdir ~/ffmpeg_sources && \
29+
cd ~/ffmpeg_sources && \
30+
curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \
31+
tar xjvf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \
32+
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
33+
make -j4 && \
34+
make install && \
35+
cd ~/ffmpeg_sources && \
36+
curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
37+
tar xzvf yasm-1.3.0.tar.gz && \
38+
cd yasm-1.3.0 && \
39+
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
40+
make -j4 && \
41+
make install && \
42+
cd ~/ffmpeg_sources && \
43+
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
44+
cd libvpx && \
45+
./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
46+
make -j4 && \
47+
make install && \
48+
cd ~/ffmpeg_sources && \
49+
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
50+
tar xjvf ffmpeg-snapshot.tar.bz2 && \
51+
cd ffmpeg && \
52+
PATH=~/bin:$PATH && \
53+
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-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
54+
make -j4 && \
55+
make install && \
56+
echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
57+
ldconfig && \
58+
rm -rf ~/ffmpeg_sources
59+
60+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
61+
ENV LDFLAGS -L/root/ffmpeg_build/lib
62+
63+
RUN mkdir libjpeg-turbo && \
64+
cd libjpeg-turbo && \
65+
export PATH=~/bin:$PATH && \
66+
curl -L https://kent.dl.sourceforge.net/project/libjpeg-turbo/1.5.3/libjpeg-turbo-1.5.3.tar.gz > libjpeg-turbo-1.5.3.tar.gz && \
67+
tar xzvf libjpeg-turbo-1.5.3.tar.gz && \
68+
cd libjpeg-turbo-1.5.3 && \
69+
export CFLAGS="-fPIC" && \
70+
export CXXFLAGS="-fPIC" && \
71+
autoreconf -fiv && \
72+
./configure --host=i686-pc-linux-gnu && \
73+
make && \
74+
make install && \
75+
cd ../../ && \
76+
rm -rf libjpeg-turbo
77+
78+
ENV JPEG_LIBRARY /opt/libjpeg-turbo/lib32/libjpeg.a
79+
ENV JPEG_INCLUDE_DIR /opt/libjpeg-turbo/include
80+
81+
RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \
82+
curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \
83+
curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \
84+
curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \
85+
mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux
86+
87+
ENV PATH "$PATH=~/bin:$PATH"

docker/Dockerfile_x86_64

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
FROM quay.io/pypa/manylinux1_x86_64:latest
2+
3+
RUN wget --no-check-certificate https://download.qt.io/official_releases/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 -prefix /opt/Qt4.8.7 -release -opensource -confirm-license && \
7+
gmake && \
8+
gmake install && \
9+
cd .. && \
10+
rm -rf qt-everywhere-opensource-src-4.8.7 && \
11+
rm qt-everywhere-opensource-src-4.8.7.tar.gz
12+
13+
ENV QTDIR /opt/Qt4.8.7
14+
ENV PATH "$QTDIR/bin:$PATH"
15+
16+
RUN wget --no-check-certificate https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \
17+
tar -zxf cmake-3.9.0.tar.gz && \
18+
cd cmake-3.9.0 && \
19+
yum -y install curl-devel zlib-devel && \
20+
./configure --system-curl && \
21+
make && \
22+
make install && \
23+
cd .. && \
24+
rm -rf cmake-3.9.0*
25+
26+
RUN yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ libtool make mercurial pkgconfig zlib-devel -y && \
27+
yum remove nasm -y && \
28+
mkdir ~/ffmpeg_sources && \
29+
cd ~/ffmpeg_sources && \
30+
curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \
31+
tar xjvf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \
32+
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
33+
make -j4 && \
< B41A /code>
34+
make install && \
35+
cd ~/ffmpeg_sources && \
36+
curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \
37+
tar xzvf yasm-1.3.0.tar.gz && \
38+
cd yasm-1.3.0 && \
39+
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \
40+
make -j4 && \
41+
make install && \
42+
cd ~/ffmpeg_sources && \
43+
git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \
44+
cd libvpx && \
45+
./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \
46+
make -j4 && \
47+
make install && \
48+
cd ~/ffmpeg_sources && \
49+
curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \
50+
tar xjvf ffmpeg-snapshot.tar.bz2 && \
51+
cd ffmpeg && \
52+
PATH=~/bin:$PATH && \
53+
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-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \
54+
make -j4 && \
55+
make install && \
56+
echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
57+
ldconfig && \
58+
rm -rf ~/ffmpeg_sources
59+
60+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig
61+
ENV LDFLAGS -L/root/ffmpeg_build/lib
62+
63+
RUN mkdir libjpeg-turbo && \
64+
cd libjpeg-turbo && \
65+
export PATH=~/bin:$PATH && \
66+
curl -L https://kent.dl.sourceforge.net/project/libjpeg-turbo/1.5.3/libjpeg-turbo-1.5.3.tar.gz > libjpeg-turbo-1.5.3.tar.gz && \
67+
tar xzvf libjpeg-turbo-1.5.3.tar.gz && \
68+
cd libjpeg-turbo-1.5.3 && \
69+
export CFLAGS="-fPIC" && \
70+
export CXXFLAGS="-fPIC" && \
71+
autoreconf -fiv && \
72+
./configure && \
73+
make && \
74+
make install && \
75+
cd ../../ && \
76+
rm -rf libjpeg-turbo
77+
78+
ENV JPEG_LIBRARY /opt/libjpeg-turbo/lib64/libjpeg.a
79+
ENV JPEG_INCLUDE_DIR /opt/libjpeg-turbo/include
80+
81+
RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \
82+
curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \
83+
curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \
84+
curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \
85+
mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux
86+
87+
ENV PATH "$PATH=~/bin:$PATH"

docker/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Customized manylinux images for opencv-python
2+
3+
This folder includes Dockerfiles for extending both ``i686`` and ``x86_64`` manylinux images.
4+
5+
The extended images were created to be able to build OpenCV in reasonable time with Travis.
6+
7+
These images have been built locally because the process takes over an hour with modern i7 processor. The images are hosted at https://quay.io/user/skvark.
8+
9+
The images have following extra software installed:
10+
11+
- Qt 4.8.7
12+
- Cmake 3.9.0
13+
- FFmpeg with libvpx
14+
- libjpeg-turbo 1.5.3
15+
- Some missing headers included from more recent Linux to be able to enable V4L / V4L2 support in OpenCV

0 commit comments

Comments
 (0)
0