|
| 1 | +FROM centos:7.6.1810 |
| 2 | + |
| 3 | +RUN if [ -n "${http_proxy}" ] ; then \ |
| 4 | + echo "proxy=${http_proxy}" >> /etc/yum.conf && \ |
| 5 | + echo "http_proxy=${http_proxy}" >> /etc/wgetrc && \ |
| 6 | + echo "https_proxy=${https_proxy}" >> /etc/wgetrc ; \ |
| 7 | + fi |
| 8 | + |
| 9 | +WORKDIR /home/immersive |
| 10 | +ARG WORKDIR=/home/immersive |
| 11 | + |
| 12 | +# Install denpendency |
| 13 | +RUN yum install -y centos-release-scl-rh && \ |
| 14 | + yum install -y wget git bzip2 xz sudo devtoolset-7-gcc* && \ |
| 15 | + wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/e/epel-release-7-14.noarch.rpm && \ |
| 16 | + rpm -Uvh epel-release*rpm && \ |
| 17 | + yum install -y openssl centos-release-scl scl-utils gmp gmp-devel && \ |
| 18 | + yum install -y mpfr mpfr-devel libmpc libmpc-devel patch autoconf && \ |
| 19 | + yum install -y libtool automake libcurl-devel libxml2-devel && \ |
| 20 | + yum install -y libevent-devel.x86_64 openssl-devel bc redhat-lsb && \ |
| 21 | + yum install -y libXrandr libXrandr-devel libXinerama libXinerama-devel && \ |
| 22 | + yum install -y libXcursor libXcursor-devel libXi libXi-devel glm-devel && \ |
| 23 | + yum install -y mesa-libGL mesa-libGL-devel mesa-libGLU && \ |
| 24 | + yum install -y mesa-libGLU-devel mesa-libGLES-devel mesa-libEGL-devel && \ |
| 25 | + yum install -y SDL2 SDL2-devel libcurl4-openssl-dev libglfw3 && \ |
| 26 | + yum install -y libXv-devel glfw glfw-devel xz-devel lzma -y && \ |
| 27 | + yum install -y uuid.x86_64 uuid-devel.x86_64 popt-devel.x86_64 -y && \ |
| 28 | + yum install -y numactl.x86_64 numactl-devel.x86_64 numactl-libs.x86_64 -y && \ |
| 29 | + rm -rf /var/cache/yum/* && rm -rf * && \ |
| 30 | + if [ -n "${http_proxy}" ]; then \ |
| 31 | + git config --global http.proxy ${http_proxy} && \ |
| 32 | + git config --global https.proxy ${https_proxy} ; \ |
| 33 | + fi |
| 34 | + |
| 35 | +RUN yum -y install rh-ruby23 rh-ruby23-ruby-devel rh-ruby23-rubygem* && \ |
| 36 | + source /opt/rh/rh-ruby23/enable && \ |
| 37 | + yum -y install rpm-build && \ |
| 38 | + if [ -n "${http_proxy}" ]; then \ |
| 39 | + gem install -p ${http_proxy} fpm ; \ |
| 40 | + else \ |
| 41 | + gem install fpm ; \ |
| 42 | + fi |
| 43 | + |
| 44 | +# Build zlib |
| 45 | +ARG ZLIB_VER=1.2.11 |
| 46 | +ARG ZILB_REPO=http://zlib.net/zlib-${ZLIB_VER}.tar.gz |
| 47 | +RUN wget -O - ${ZILB_REPO} | tar xz && \ |
| 48 | + cd zlib-${ZLIB_VER} && \ |
| 49 | + source /opt/rh/devtoolset-7/enable && \ |
| 50 | + ./configure && \ |
| 51 | + make -j$(nproc) && \ |
| 52 | + make install && \ |
| 53 | + cd ${WORKDIR} && rm -rf ./* |
| 54 | + |
| 55 | +# Install cmake |
| 56 | +ARG CMAKE_VER=3.12.4 |
| 57 | +ARG CMAKE_REPO=https://cmake.org/files |
| 58 | +RUN wget -O - ${CMAKE_REPO}/v${CMAKE_VER%.*}/cmake-${CMAKE_VER}.tar.gz | tar xz && \ |
| 59 | + cd cmake-${CMAKE_VER} && \ |
| 60 | + source /opt/rh/devtoolset-7/enable && \ |
| 61 | + ./bootstrap --prefix="/usr" --system-curl && \ |
| 62 | + make -j$(nproc) && \ |
| 63 | + make install && \ |
| 64 | + cd ${WORKDIR} && rm -rf ./* |
| 65 | + |
| 66 | +# Build YASM |
| 67 | +ARG YASM_VER=1.3.0 |
| 68 | +ARG YASM_REPO=https://www.tortall.net/projects/yasm/releases/yasm-${YASM_VER}.tar.gz |
| 69 | +RUN wget --no-check-certificate -O - ${YASM_REPO} | tar xz && \ |
| 70 | + cd yasm-${YASM_VER} && \ |
| 71 | + sed -i "s/) ytasm.*/)/" Makefile.in && \ |
| 72 | + source /opt/rh/devtoolset-7/enable && \ |
| 73 | + ./configure --prefix="/usr" --libdir=/usr/lib/x86_64-linux-gnu && \ |
| 74 | + make -j$(nproc) && \ |
| 75 | + make install && \ |
| 76 | + cd ${WORKDIR} && rm -rf ./* |
| 77 | + |
| 78 | +# Build CURL |
| 79 | +ARG CURL_VER=7.66.0 |
| 80 | +ARG CURL_REPO=https://curl.haxx.se/download/curl-${CURL_VER}.tar.xz |
| 81 | +RUN wget --no-check-certificate ${CURL_REPO} && \ |
| 82 | + xz -d curl-${CURL_VER}.tar.xz && \ |
| 83 | + tar -xvf curl-${CURL_VER}.tar && \ |
| 84 | + cd curl-${CURL_VER} && \ |
| 85 | + source /opt/rh/devtoolset-7/enable && \ |
| 86 | + ./configure --with-darwinssl && \ |
| 87 | + make -j$(nproc) && \ |
| 88 | + make install && \ |
| 89 | + cd ${WORKDIR} && rm -rf ./* |
| 90 | + |
| 91 | +# Install BOOST |
| 92 | +ARG BOOST_REPO=https://sourceforge.net/projects/boost/files/boost/1.63.0/boost_1_63_0.tar.gz |
| 93 | +RUN wget --no-check-certificate -O - ${BOOST_REPO} | tar xz && \ |
| 94 | + cd boost_1_63_0 && \ |
| 95 | + source /opt/rh/devtoolset-7/enable && \ |
| 96 | + ./bootstrap.sh --without-libraries=python && \ |
| 97 | + ./b2 -a cxxflags="-D_GLIBCXX_USE_CXX11_ABI=0" -j`nproc` && \ |
| 98 | + ./b2 cxxflags="-D_GLIBCXX_USE_CXX11_ABI=0" install && \ |
| 99 | + cd ${WORKDIR} && rm -rf ./boost_1_63_0* |
| 100 | + |
| 101 | +# Install SVT |
| 102 | +RUN git clone https://github.com/OpenVisualCloud/SVT-HEVC.git && \ |
| 103 | + cd SVT-HEVC && \ |
| 104 | + source /opt/rh/devtoolset-7/enable && \ |
| 105 | + git checkout ec0d95c7e0d5be20586e1b87150bdfb9ae97cf4d && \ |
| 106 | + cd Build/linux/ && \ |
| 107 | + ./build.sh && \ |
| 108 | + cd Release && \ |
| 109 | + make install && \ |
| 110 | + cd ${WORKDIR} && rm -rf ./SVT-HEVC |
| 111 | + |
| 112 | +# Install glog |
| 113 | +RUN git clone https://github.com/google/glog.git && \ |
| 114 | + cd glog && \ |
| 115 | + git checkout v0.5.0 && \ |
| 116 | + source /opt/rh/devtoolset-7/enable && \ |
| 117 | + sed -i '23s/OFF/ON/' CMakeLists.txt && \ |
| 118 | + cmake -H. -Bbuild -G "Unix Makefiles" && \ |
| 119 | + cmake --build build && \ |
| 120 | + cmake --build build --target install && \ |
| 121 | + cd ${WORKDIR} && rm -rf ./glog |
| 122 | + |
| 123 | +# Install lttng |
| 124 | +RUN source /opt/rh/devtoolset-7/enable && \ |
| 125 | + wget --no-check-certificate -c https://lttng.org/files/urcu/userspace-rcu-latest-0.11.tar.bz2 && \ |
| 126 | + tar -xjf userspace-rcu-latest-0.11.tar.bz2 && \ |
| 127 | + cd userspace-rcu-0.11.* && \ |
| 128 | + ./configure && \ |
| 129 | + make -j $(nproc) && \ |
| 130 | + make install && ldconfig && \ |
| 131 | + cd ../ && rm -rf userspace-rcu-0.11.* && \ |
| 132 | + wget --no-check-certificate -c http://lttng.org/files/lttng-ust/lttng-ust-latest-2.11.tar.bz2 && \ |
| 133 | + tar -xjf lttng-ust-latest-2.11.tar.bz2 && \ |
| 134 | + cd lttng-ust-2.11.* && \ |
| 135 | + ./configure --disable-man-pages && \ |
| 136 | + make -j $(nproc) && \ |
| 137 | + make install && ldconfig && \ |
| 138 | + cd ../ && rm -rf lttng-ust-2.11.* |
| 139 | + |
| 140 | +# Copy source |
| 141 | +COPY ./src ${WORKDIR} |
| 142 | +COPY src/ffmpeg/dependency/*.so /usr/local/lib/ |
| 143 | +COPY src/ffmpeg/dependency/*.pc /usr/local/lib/pkgconfig/ |
| 144 | +COPY src/ffmpeg/dependency/*.h /usr/local/include/ |
| 145 | +COPY src/ffmpeg/dependency/WorkerServer /root |
| 146 | + |
| 147 | +# Install Thrift |
| 148 | +ARG THRIFT_VER=0.12.0 |
| 149 | +ARG THRIFT_REPO=http://apache.osuosl.org/thrift/${THRIFT_VER}/thrift-${THRIFT_VER}.tar.gz |
| 150 | +RUN wget --no-check-certificate -O - ${THRIFT_REPO} | tar xz && \ |
| 151 | + cd thrift-${THRIFT_VER} && \ |
| 152 | + source /opt/rh/devtoolset-7/enable && \ |
| 153 | + patch configure ../external/Disable_cxx11_abi_for_thrift.patch && \ |
| 154 | + sed -i '21 a # include <unistd.h>' ./lib/cpp/src/thrift/transport/PlatformSocket.h && \ |
| 155 | + ./configure --with-boost=/usr/local --with-boost-libdir=/usr/local/lib --with-libevent=/usr --with-java=0 && \ |
| 156 | + make -j`nproc` && \ |
| 157 | + make install && \ |
| 158 | + cd ${WORKDIR} && rm -rf ./thrift-${THRIFT_VER}* |
| 159 | + |
| 160 | +# Install openHEVC |
| 161 | +RUN git clone https://github.com/OpenHEVC/openHEVC.git && \ |
| 162 | + cd openHEVC && \ |
| 163 | + source /opt/rh/devtoolset-7/enable && \ |
| 164 | + git config --global user.email " [email protected]" && \ |
| 165 | + git config --global user.name "Your Name" && \ |
| 166 | + git checkout ffmpeg_update && \ |
| 167 | + git am --whitespace=fix ../external/Update-buffer-operation-and-fix-stream-loop-coredump.patch && \ |
| 168 | + ./configure --libdir=/usr/lib64 --disable-sdl2 && \ |
| 169 | + make -j `nproc` && \ |
| 170 | + make install && \ |
| 171 | + cd ${WORKDIR} && rm -rf ./openHEVC |
| 172 | + |
| 173 | +# Build Nginx |
| 174 | +ARG NGINX_VER=1.13.1 |
| 175 | +ARG NGINX_REPO=http://nginx.org/download/nginx-${NGINX_VER}.tar.gz |
| 176 | +RUN wget --no-check-certificate -O - ${NGINX_REPO} | tar xz && \ |
| 177 | + cd nginx-${NGINX_VER} && \ |
| 178 | + source /opt/rh/devtoolset-7/enable && \ |
| 179 | + ./configure --with-http_ssl_module && \ |
| 180 | + make -j `nproc` && \ |
| 181 | + make install && \ |
| 182 | + cd ${WORKDIR} && rm -rf ./nginx* |
| 183 | +EXPOSE 443 |
| 184 | +EXPOSE 8080 |
| 185 | + |
| 186 | +# Build safe string lib |
| 187 | +RUN git clone https://github.com/intel/safestringlib.git && \ |
| 188 | + cd safestringlib && \ |
| 189 | + source /opt/rh/devtoolset-7/enable && \ |
| 190 | + cmake . && \ |
| 191 | + make -j `nproc` -f Makefile && \ |
| 192 | + cp libsafestring_shared.so /usr/local/lib/ && \ |
| 193 | + mkdir -p /usr/local/include/safestringlib/ && \ |
| 194 | + cp ./include/* /usr/local/include/safestringlib/ && \ |
| 195 | + cd ${WORKDIR} && rm -rf ./safestringlib |
| 196 | + |
| 197 | +# Configure And Run Nginx |
| 198 | +COPY nginx_conf /usr/local/nginx/conf |
| 199 | + |
| 200 | +# Unset proxy if necessary |
| 201 | +RUN if [ -n "${http_proxy}" ]; then \ |
| 202 | + sed -i '$d' /etc/yum.conf && \ |
| 203 | + sed -i '1,$d' /etc/wgetrc && \ |
| 204 | + git config --global --unset http.proxy && \ |
| 205 | + git config --global --unset https.proxy ; \ |
| 206 | + fi |
0 commit comments