fix: 完善ustreamer编译缓存解决方案

- 在编译完成后将目录重命名为标准路径 /tmp/ustreamer
- 确保后续构建步骤能正确引用 ustreamer 二进制文件
- 保持缓存破坏机制的同时维护构建流程的兼容性
This commit is contained in:
mofeng-git
2025-08-23 10:05:00 +08:00
parent 16878dc7ff
commit 0b4d83dc93
2 changed files with 7 additions and 13 deletions

View File

@@ -132,13 +132,14 @@ RUN git clone --depth=1 https://gitlab.freedesktop.org/libnice/libnice /tmp/libn
&& rm -rf /tmp/janus-gateway
# 编译 ustreamer
ARG CACHEBUST=1
RUN echo "Cache bust: $CACHEBUST" \
RUN echo "Building ustreamer with timestamp cache bust" \
&& sed --in-place --expression 's|^#include "refcount.h"$|#include "../refcount.h"|g' /usr/include/janus/plugins/plugin.h \
&& git clone --depth=1 https://github.com/mofeng-git/ustreamer /tmp/ustreamer \
&& make -j WITH_PYTHON=1 WITH_JANUS=1 WITH_FFMPEG=1 -C /tmp/ustreamer \
&& /tmp/ustreamer/ustreamer -v \
&& cp /tmp/ustreamer/python/dist/*.whl /tmp/wheel/
&& TIMESTAMP=$(date +%s%N) \
&& git clone --depth=1 https://github.com/mofeng-git/ustreamer /tmp/ustreamer-${TIMESTAMP} \
&& make -j WITH_PYTHON=1 WITH_JANUS=1 WITH_FFMPEG=1 -C /tmp/ustreamer-${TIMESTAMP} \
&& /tmp/ustreamer-${TIMESTAMP}/ustreamer -v \
&& cp /tmp/ustreamer-${TIMESTAMP}/python/dist/*.whl /tmp/wheel/ \
&& mv /tmp/ustreamer-${TIMESTAMP} /tmp/ustreamer
# 复制必要的库文件
RUN mkdir /tmp/lib \