Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

131 wiersze
4.2KB

  1. ARG Version=7
  2. FROM centos:${Version} As build
  3. ARG HTTP_PROXY=${NO_PROXY}
  4. ARG HTTPS_PROXY=${NO_PROXY}
  5. ARG PKG_CONFIG_VERSION=0.29.2
  6. ARG CMAKE_VERSION=3.18
  7. ARG CMAKE_FULL_VERSION=3.18.4
  8. ARG YASM_VERSION=1.3.0
  9. ARG NASM_VERSION=2.15.05
  10. ARG X265_VERSION=3.4
  11. RUN yum install -y \
  12. gcc \
  13. gcc-c++ \
  14. kernel-devel \
  15. kernel-headers \
  16. openssl \
  17. openssl-devel \
  18. git \
  19. wget \
  20. which
  21. WORKDIR /opt
  22. RUN wget -e "https_proxy=${HTTPS_PROXY}" https://pkgconfig.freedesktop.org/releases/pkg-config-${PKG_CONFIG_VERSION}.tar.gz \
  23. && tar -zxvf pkg-config-${PKG_CONFIG_VERSION}.tar.gz \
  24. && cd pkg-config-${PKG_CONFIG_VERSION} \
  25. && ./configure --with-internal-glib \
  26. && make -j8 \
  27. && make install
  28. RUN wget -e "https_proxy=${HTTPS_PROXY}" https://cmake.org/files/v${CMAKE_VERSION}/cmake-${CMAKE_FULL_VERSION}.tar.gz \
  29. && tar -zxvf cmake-${CMAKE_FULL_VERSION}.tar.gz \
  30. && cd cmake-${CMAKE_FULL_VERSION} \
  31. && ./bootstrap \
  32. && gmake -j8 \
  33. && gmake install
  34. RUN cd /opt \
  35. && wget -e "https_proxy=${HTTPS_PROXY}" http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz \
  36. && tar zxvf yasm-${YASM_VERSION}.tar.gz \
  37. && cd yasm-${YASM_VERSION} \
  38. && ./configure \
  39. && make -j8 \
  40. && make install
  41. RUN wget -e "https_proxy=${HTTPS_PROXY}" https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-${NASM_VERSION}.tar.xz \
  42. && tar -xvJf nasm-${NASM_VERSION}.tar.xz \
  43. && cd nasm-${NASM_VERSION} \
  44. && ./configure --disable-shared --enable-static \
  45. && make -j8 \
  46. && make install
  47. RUN cd /opt \
  48. && git clone https://code.videolan.org/videolan/x264.git \
  49. && cd x264 \
  50. && git checkout -b stable origin/stable \
  51. && git pull --rebase \
  52. && ./configure --enable-pic --enable-shared --disable-asm \
  53. && make -j8 \
  54. && make install \
  55. && export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
  56. RUN cd /opt \
  57. && wget -e "https_proxy=${HTTPS_PROXY}" https://github.com/videolan/x265/archive/Release_${X265_VERSION}.tar.gz \
  58. && tar zxvf Release_${X265_VERSION}.tar.gz \
  59. && cd x265-Release_${X265_VERSION}/build/linux \
  60. && cmake ../../source \
  61. && make -j8 \
  62. && make install \
  63. && export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
  64. RUN cd /opt \
  65. && git clone https://gitee.com/xia-chu/FFmpeg.git \
  66. && cd /opt/FFmpeg \
  67. && export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH \
  68. && ./configure \
  69. --disable-debug \
  70. --disable-doc \
  71. --disable-shared \
  72. --enable-gpl \
  73. --enable-version3 \
  74. --enable-static \
  75. --enable-nonfree \
  76. --enable-pthreads \
  77. --enable-libx264 \
  78. --enable-libx265 \
  79. --enable-small \
  80. --pkgconfigdir=/usr/local/lib/pkgconfig \
  81. --pkg-config-flags="--static" \
  82. && make -j8 \
  83. && make install
  84. RUN cd /opt \
  85. && git clone --depth 1 https://github.com/xia-chu/ZLMediaKit.git \
  86. && cd ZLMediaKit \
  87. && git submodule update --init \
  88. && mkdir -p build release/linux/Release/ \
  89. && cd build \
  90. && cmake -DCMAKE_BUILD_TYPE=Release .. \
  91. && make -j8
  92. RUN mkdir -p /opt/build/opt/zlm/ /opt/build/usr/local/bin/ /opt/build/usr/bin/ /opt/build/usr/local/lib/ /opt/build/etc/localtime \
  93. && cd /opt/build \
  94. && /usr/bin/cp -ip /usr/local/lib/libx26* ./usr/local/lib \
  95. && /usr/bin/cp -ip /usr/local/bin/ffmpeg ./usr/local/bin \
  96. && /usr/bin/cp -ip /opt/ZLMediaKit/release/linux/Release/MediaServer ./opt/zlm/ \
  97. && /usr/bin/cp -irp /opt/ZLMediaKit/release/linux/Release/www ./opt/zlm/ \
  98. && /usr/bin/cp -ip /opt/ZLMediaKit/tests/ssl.p12 ./opt/zlm/ \
  99. && /usr/bin/cp -ip /usr/bin/which ./usr/bin/
  100. FROM centos:${Version}
  101. LABEL maintainer="chengxiaosheng <kevin__cheng@outlook.com>" project-url="https://github.com/xia-chu/ZLMediaKit" description="一个基于C++11的高性能运营级流媒体服务框架"
  102. EXPOSE 9000/tcp \
  103. 1935/tcp \
  104. 19350/tcp \
  105. 554/tcp \
  106. 322/tcp \
  107. 80/tcp \
  108. 443/tcp \
  109. 10000/udp \
  110. 10000/tcp
  111. WORKDIR /opt/zlm
  112. VOLUME [ "/opt/zlm/conf/","/opt/zlm/log/","opt/zlm/ffmpeg/"]
  113. COPY --from=build /opt/build /
  114. ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH TZ=Asia/Shanghai
  115. CMD ./MediaServer -c ./conf/config.ini