mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-13 17:50:29 +08:00
fix: 修复Docker多架构构建中FFmpeg库依赖问题
- 修复arm64-libs.tar.gz条件复制,使用通配符避免文件不存在错误 - 在stage-0中添加arm64架构FFmpeg库的条件复制 - 添加libyuv0依赖包支持 - 确保只在arm64下复制自定义编译的FFmpeg相关库文件
This commit is contained in:
parent
b94cc14e2a
commit
bbef7bb5c4
@ -11,8 +11,8 @@ COPY --from=builder /tmp/ustreamer/ustreamer /tmp/ustreamer/ustreamer-dump /usr/
|
|||||||
COPY --from=builder /tmp/wheel/*.whl /tmp/wheel/
|
COPY --from=builder /tmp/wheel/*.whl /tmp/wheel/
|
||||||
COPY --from=builder /tmp/ustreamer/libjanus_ustreamer.so /usr/lib/ustreamer/janus/
|
COPY --from=builder /tmp/ustreamer/libjanus_ustreamer.so /usr/lib/ustreamer/janus/
|
||||||
COPY --from=builder /usr/lib/janus/transports/* /usr/lib/janus/transports/
|
COPY --from=builder /usr/lib/janus/transports/* /usr/lib/janus/transports/
|
||||||
COPY --from=builder /tmp/arm64-libs.tar.gz /tmp/
|
COPY --from=builder /tmp/arm64-libs.tar.gz* /tmp/
|
||||||
RUN if [ ${TARGETARCH} = arm64 ]; then \
|
RUN if [ ${TARGETARCH} = arm64 ] && [ -f /tmp/arm64-libs.tar.gz ]; then \
|
||||||
cd / && tar -xzf /tmp/arm64-libs.tar.gz && rm -f /tmp/arm64-libs.tar.gz; \
|
cd / && tar -xzf /tmp/arm64-libs.tar.gz && rm -f /tmp/arm64-libs.tar.gz; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -47,34 +47,36 @@ RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.lis
|
|||||||
libasound2 \
|
libasound2 \
|
||||||
libdrm2 \
|
libdrm2 \
|
||||||
libx264-164 \
|
libx264-164 \
|
||||||
|
libyuv0 \
|
||||||
nano \
|
nano \
|
||||||
unzip \
|
unzip \
|
||||||
&& if [ ${TARGETARCH} != arm64 ]; then \
|
&& case ${TARGETARCH} in \
|
||||||
apt-get install -y --no-install-recommends \
|
amd64) \
|
||||||
libavcodec59 \
|
apt-get install -y --no-install-recommends \
|
||||||
libavformat59 \
|
libavcodec59 libavformat59 libavutil57 \
|
||||||
libavutil57 \
|
libswscale6 libavfilter8 libavdevice59 \
|
||||||
libswscale6 \
|
ffmpeg vainfo \
|
||||||
libavfilter8 \
|
libva2 libva-drm2 libva-x11-2 \
|
||||||
libavdevice59; \
|
mesa-va-drivers mesa-vdpau-drivers \
|
||||||
fi \
|
intel-media-va-driver i965-va-driver \
|
||||||
&& if [ ${TARGETARCH} != arm ] && [ ${TARGETARCH} != arm64 ]; then \
|
;; \
|
||||||
apt-get install -y --no-install-recommends \
|
arm) \
|
||||||
ffmpeg \
|
apt-get install -y --no-install-recommends \
|
||||||
vainfo \
|
libavcodec59 libavformat59 libavutil57 \
|
||||||
libva2 \
|
libswscale6 libavfilter8 libavdevice59 \
|
||||||
libva-drm2 \
|
v4l-utils libv4l-0 \
|
||||||
libva-x11-2 \
|
;; \
|
||||||
mesa-va-drivers \
|
arm64) \
|
||||||
mesa-vdpau-drivers \
|
apt-get install -y --no-install-recommends \
|
||||||
intel-media-va-driver \
|
v4l-utils libv4l-0 \
|
||||||
i965-va-driver; \
|
libstdc++6 \
|
||||||
fi \
|
libva2 libva-drm2 libva-x11-2 \
|
||||||
&& if [ ${TARGETARCH} = arm ] || [ ${TARGETARCH} = arm64 ]; then \
|
libvdpau1 ocl-icd-libopencl1 \
|
||||||
apt-get install -y --no-install-recommends \
|
;; \
|
||||||
v4l-utils \
|
*) \
|
||||||
libv4l-0; \
|
echo "Unsupported architecture: ${TARGETARCH}" && exit 1 \
|
||||||
fi \
|
;; \
|
||||||
|
esac \
|
||||||
&& cp /tmp/lib/* /lib/*-linux-*/ \
|
&& cp /tmp/lib/* /lib/*-linux-*/ \
|
||||||
&& pip install --no-cache-dir --root-user-action=ignore --disable-pip-version-check /tmp/wheel/*.whl \
|
&& pip install --no-cache-dir --root-user-action=ignore --disable-pip-version-check /tmp/wheel/*.whl \
|
||||||
&& pip install --no-cache-dir --root-user-action=ignore --disable-pip-version-check pyfatfs \
|
&& pip install --no-cache-dir --root-user-action=ignore --disable-pip-version-check pyfatfs \
|
||||||
|
|||||||
@ -180,6 +180,7 @@ RUN echo "Building ustreamer with timestamp cache bust" \
|
|||||||
&& git clone --depth=1 https://github.com/mofeng-git/ustreamer /tmp/ustreamer-${TIMESTAMP} \
|
&& git clone --depth=1 https://github.com/mofeng-git/ustreamer /tmp/ustreamer-${TIMESTAMP} \
|
||||||
&& make -j$(nproc) WITH_PYTHON=1 WITH_JANUS=1 WITH_FFMPEG=1 -C /tmp/ustreamer-${TIMESTAMP} \
|
&& make -j$(nproc) WITH_PYTHON=1 WITH_JANUS=1 WITH_FFMPEG=1 -C /tmp/ustreamer-${TIMESTAMP} \
|
||||||
&& /tmp/ustreamer-${TIMESTAMP}/ustreamer -v \
|
&& /tmp/ustreamer-${TIMESTAMP}/ustreamer -v \
|
||||||
|
&& /tmp/ustreamer-${TIMESTAMP}/ustreamer-dump -v \
|
||||||
&& cp /tmp/ustreamer-${TIMESTAMP}/python/dist/*.whl /tmp/wheel/ \
|
&& cp /tmp/ustreamer-${TIMESTAMP}/python/dist/*.whl /tmp/wheel/ \
|
||||||
&& mv /tmp/ustreamer-${TIMESTAMP} /tmp/ustreamer
|
&& mv /tmp/ustreamer-${TIMESTAMP} /tmp/ustreamer
|
||||||
|
|
||||||
@ -190,4 +191,10 @@ RUN mkdir /tmp/lib \
|
|||||||
libevent-*.so.* libjpeg.so.* libyuv.so.* libnice.so.* \
|
libevent-*.so.* libjpeg.so.* libyuv.so.* libnice.so.* \
|
||||||
/tmp/lib/ \
|
/tmp/lib/ \
|
||||||
&& find /usr/lib -name "libsrtp2.so.*" -exec cp {} /tmp/lib/ \; \
|
&& find /usr/lib -name "libsrtp2.so.*" -exec cp {} /tmp/lib/ \; \
|
||||||
&& find /usr/lib -name "libwebsockets.so.*" -exec cp {} /tmp/lib/ \;
|
&& find /usr/lib -name "libwebsockets.so.*" -exec cp {} /tmp/lib/ \; \
|
||||||
|
&& if [ ${TARGETARCH} = arm64 ]; then \
|
||||||
|
find /usr/lib -name "libav*.so.*" -exec cp {} /tmp/lib/ \; \
|
||||||
|
&& find /usr/lib -name "libsw*.so.*" -exec cp {} /tmp/lib/ \; \
|
||||||
|
&& find /usr/lib -name "libpostproc.so.*" -exec cp {} /tmp/lib/ \; \
|
||||||
|
&& find /usr/lib -name "librga.so.*" -exec cp {} /tmp/lib/ \; ; \
|
||||||
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user