-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy pathDockerfile_x86_64
More file actions
179 lines (160 loc) · 6.63 KB
/
Dockerfile_x86_64
File metadata and controls
179 lines (160 loc) · 6.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Version: 20260102
# Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64
FROM quay.io/pypa/manylinux2014_x86_64:latest
ARG CCACHE_VERSION=3.7.9
ARG FFMPEG_VERSION=8.0.1
ARG FREETYPE_VERSION=2.14.1
ARG LIBPNG_VERSION=1.6.53
ARG VPX_VERSION=v1.15.2
ARG NASM_VERSION=2.15.04
ARG QT_VERSION=5.15.18
ARG YASM_VERSION=1.3.0
ARG AOM_VERSION=v3.13.1
ARG AVIF_VERSION=v1.3.0
ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH
# Base dependencies + system OpenSSL (FIPS-safe)
RUN yum install -y \
zlib-devel \
curl-devel \
xcb-util-renderutil-devel \
xcb-util-devel \
xcb-util-image-devel \
xcb-util-keysyms-devel \
xcb-util-wm-devel \
mesa-libGL-devel \
libxkbcommon-devel \
libxkbcommon-x11-devel \
libXi-devel \
lapack-devel \
epel-release \
openssl \
openssl-devel && \
yum install -y openblas-devel dejavu-sans-fonts && \
cp /usr/include/openblas/*.h /usr/include/ && \
cp /usr/include/lapacke/lapacke*.h /usr/include/ && \
yum remove -y libpng
# libpng
RUN mkdir ~/libpng_sources && \
cd ~/libpng_sources && \
curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \
tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \
cd libpng-${LIBPNG_VERSION} && \
./configure --prefix=/usr/local && \
make && make install && \
cd .. && rm -rf ~/libpng_sources
# freetype
RUN mkdir ~/freetype_sources && \
cd ~/freetype_sources && \
curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \
tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \
cd freetype-${FREETYPE_VERSION} && \
./configure --prefix="/ffmpeg_build" --enable-freetype-config && \
make && make install && \
cd .. && rm -rf ~/freetype_sources
# Qt (explicitly without OpenSSL)
RUN curl -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \
cd qt-everywhere-src-${QT_VERSION} && \
export MAKEFLAGS=-j$(nproc) && \
./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license \
-qtnamespace QtOpenCVPython \
-xcb -xcb-xlib -bundled-xcb-xinput \
-no-openssl -no-dbus \
-skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity \
-skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects \
-skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing \
-skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript \
-skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport \
-skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel \
-skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns \
-skip declarative -make libs && \
make && make install && \
cd .. && rm -rf qt-everywhere*
ENV QTDIR /opt/Qt${QT_VERSION}
ENV PATH "$QTDIR/bin:$PATH"
# nasm
RUN mkdir ~/nasm_sources && \
cd ~/nasm_sources && \
curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \
tar -xf nasm-${NASM_VERSION}.tar.gz && \
cd nasm-${NASM_VERSION} && ./autogen.sh && \
./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \
make -j$(getconf _NPROCESSORS_ONLN) && make install && \
cd .. && rm -rf ~/nasm_sources
# yasm
RUN mkdir ~/yasm_sources && \
cd ~/yasm_sources && \
curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \
tar -xf yasm-${YASM_VERSION}.tar.gz && \
cd yasm-${YASM_VERSION} && \
./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \
make -j$(getconf _NPROCESSORS_ONLN) && make install && \
cd .. && rm -rf ~/yasm_sources
# libvpx
RUN mkdir ~/libvpx_sources && \
cd ~/libvpx_sources && \
git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \
cd libvpx && \
./configure --prefix="/ffmpeg_build" \
--disable-examples --disable-unit-tests \
--enable-vp9-highbitdepth --as=yasm \
--enable-pic --enable-shared && \
make -j$(getconf _NPROCESSORS_ONLN) && make install && \
cd .. && rm -rf ~/libvpx_sources
# aom
RUN mkdir ~/aom_sources && \
cd ~/aom_sources && \
git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF ../aom && \
make -j$(getconf _NPROCESSORS_ONLN) && make install && \
cd / && rm -rf ~/aom_sources
# avif
RUN mkdir ~/avif_sources && \
cd ~/avif_sources && \
git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \
mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DAVIF_CODEC_AOM=SYSTEM \
-DAVIF_LIBYUV=LOCAL \
-DAVIF_BUILD_APPS=OFF ../libavif && \
make -j$(getconf _NPROCESSORS_ONLN) && make install && \
cd / && rm -rf ~/avif_sources
# ffmpeg (uses system OpenSSL for FIPS compatibility)
RUN mkdir ~/ffmpeg_sources && \
cd ~/ffmpeg_sources && \
curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \
tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \
cd ffmpeg-${FFMPEG_VERSION} && \
PATH=~/bin:$PATH && \
PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig" \
./configure \
--prefix="/ffmpeg_build" \
--extra-cflags="-I/ffmpeg_build/include" \
--extra-ldflags="-L/ffmpeg_build/lib" \
--enable-openssl \
--enable-libvpx \
--enable-shared \
--enable-pic \
--bindir="$HOME/bin" && \
make -j$(getconf _NPROCESSORS_ONLN) && make install && \
echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \
ldconfig && \
rm -rf ~/ffmpeg_sources
# ccache
RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \
tar -xf ccache-${CCACHE_VERSION}.tar.gz && \
cd ccache-${CCACHE_VERSION} && \
./configure && \
make -j$(getconf _NPROCESSORS_ONLN) && make install && \
cd .. && rm -rf ccache-${CCACHE_VERSION}.tar.gz
# CI user
RUN useradd ci -m -s /bin/bash -G users --uid=1001 && \
mkdir /io && chown -R ci:ci /io && \
chown -R ci:ci /ffmpeg_build && \
chown -R ci:ci /opt/_internal/pipx/venvs/auditwheel
USER ci
RUN git config --global --add safe.directory /io
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig
ENV LDFLAGS -L/ffmpeg_build/lib
ENV PATH "$HOME/bin:$PATH"