# 标记此处构建使用容器内构建镜像体 AS build关键词 FROM dockerpull.com/ubuntu:20.04 AS build #shell,rtmp,rtsp,rtsps,http,https,rtp EXPOSE9000/tcp EXPOSE8000/tcp EXPOSE8000/udp EXPOSE1935/tcp EXPOSE554/tcp EXPOSE322/tcp EXPOSE80/tcp EXPOSE443/tcp EXPOSE10000/udp EXPOSE10000/tcp
# 国内Ubuntu软件仓访问速度太慢,使用华为云镜像地址加速处理 RUN sed -i 's/archive.ubuntu.com/mirrors.huaweicloud.com/g' /etc/apt/sources.list RUN sed -i 's/security.ubuntu.com/mirrors.huaweicloud.com/g' /etc/apt/sources.list RUN sed -i 's/ports.ubuntu.com/mirrors.huaweicloud.com/g' /etc/apt/sources.list
WORKDIR /opt/media/ZLMediaKit/libs RUN tar -xvf openssl-1.1.1k.tar.gz && tar -xvf libsrtp-2.3.0.tar.gz
WORKDIR /opt/media/ZLMediaKit/libs/openssl-1.1.1k/ RUN ./config shared --openssldir=/usr/local/openssl --prefix=/usr/local/openssl && make && make install
WORKDIR /opt/media/ZLMediaKit/libs/libsrtp-2.3.0/ RUN ./configure --enable-openssl --with-openssl-dir=/usr/local/openssl && make -j8 && make install
WORKDIR /opt/media/ZLMediaKit/build RUN cmake .. -DENABLE_WEBRTC=true -DOPENSSL_ROOT_DIR=/usr/local/openssl -DOPENSSL_LIBRARIES=/usr/local/openssl/lib -DCMAKE_BUILD_TYPE=Release &&\ make -j4 # 这里是构建镜像真实路径 FROM dockerpull.com/ubuntu:20.04
RUN sed -i 's/archive.ubuntu.com/mirrors.huaweicloud.com/g' /etc/apt/sources.list RUN sed -i 's/security.ubuntu.com/mirrors.huaweicloud.com/g' /etc/apt/sources.list RUN sed -i 's/ports.ubuntu.com/mirrors.huaweicloud.com/g' /etc/apt/sources.list