Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

dockerfile 2.5KB

il y a 6 mois
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. FROM ubuntu:18.04 AS build
  2. ARG MODEL
  3. #shell,rtmp,rtsp,rtsps,http,https,rtp
  4. EXPOSE 1935/tcp
  5. EXPOSE 554/tcp
  6. EXPOSE 80/tcp
  7. EXPOSE 443/tcp
  8. EXPOSE 10000/udp
  9. EXPOSE 10000/tcp
  10. EXPOSE 8000/udp
  11. EXPOSE 9000/udp
  12. # ADD sources.list /etc/apt/sources.list
  13. RUN apt-get update && \
  14. DEBIAN_FRONTEND="noninteractive" \
  15. apt-get install -y --no-install-recommends \
  16. build-essential \
  17. cmake \
  18. git \
  19. curl \
  20. vim \
  21. wget \
  22. ca-certificates \
  23. tzdata \
  24. libssl-dev \
  25. libmysqlclient-dev \
  26. libx264-dev \
  27. libfaac-dev \
  28. gcc \
  29. g++ \
  30. libavcodec-dev libavutil-dev libswscale-dev libresample-dev \
  31. gdb && \
  32. apt-get autoremove -y && \
  33. apt-get clean -y && \
  34. wget https://github.com/cisco/libsrtp/archive/v2.2.0.tar.gz -O libsrtp-2.2.0.tar.gz && tar xfv libsrtp-2.2.0.tar.gz && \
  35. cd libsrtp-2.2.0 && ./configure --enable-openssl && make -j $(nproc) && make install && \
  36. rm -rf /var/lib/apt/lists/*
  37. RUN mkdir -p /opt/media
  38. COPY . /opt/media/ZLMediaKit
  39. WORKDIR /opt/media/ZLMediaKit
  40. #RUN git submodule update --init --recursive && \
  41. RUN mkdir -p build release/linux/${MODEL}/
  42. WORKDIR /opt/media/ZLMediaKit/build
  43. RUN cmake -DCMAKE_BUILD_TYPE=${MODEL} -DENABLE_WEBRTC=true -DENABLE_FFMPEG=true -DENABLE_TESTS=false -DENABLE_API=false .. && \
  44. make -j $(nproc)
  45. FROM ubuntu:18.04
  46. ARG MODEL
  47. # ADD sources.list /etc/apt/sources.list
  48. RUN apt-get update && \
  49. DEBIAN_FRONTEND="noninteractive" \
  50. apt-get install -y --no-install-recommends \
  51. vim \
  52. wget \
  53. ca-certificates \
  54. tzdata \
  55. curl \
  56. libssl-dev \
  57. libx264-dev \
  58. libfaac-dev \
  59. ffmpeg \
  60. gcc \
  61. g++ \
  62. libavcodec-dev libavutil-dev libswscale-dev libresample-dev \
  63. gdb && \
  64. apt-get autoremove -y && \
  65. apt-get clean -y && \
  66. rm -rf /var/lib/apt/lists/*
  67. ENV TZ=Asia/Shanghai
  68. RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
  69. && echo $TZ > /etc/timezone && \
  70. mkdir -p /opt/media/bin/www
  71. WORKDIR /opt/media/bin/
  72. COPY --from=build /opt/media/ZLMediaKit/release/linux/${MODEL}/MediaServer /opt/media/ZLMediaKit/default.pem /opt/media/bin/
  73. COPY --from=build /opt/media/ZLMediaKit/release/linux/${MODEL}/config.ini /opt/media/conf/
  74. COPY --from=build /opt/media/ZLMediaKit/www/ /opt/media/bin/www/
  75. ENV PATH /opt/media/bin:$PATH
  76. CMD ["sh","-c","./MediaServer -s default.pem -c ../conf/config.ini"]