penta 4 дней назад
Родитель
Сommit
e7a1ad59f3
1 измененных файлов с 36 добавлено и 37 удалено
  1. 36 37
      Dockerfile

+ 36 - 37
Dockerfile

@@ -192,6 +192,10 @@ RUN set -eux; \
     test -f /out/index.html
     test -f /out/index.html
 
 
 
 
+# -----------------------------------------------------------------------------
+# Build the legacy Pixelflux capture library required by pixelflux 1.6.4
+# -----------------------------------------------------------------------------
+
 FROM docker.io/library/ubuntu:${DISTRIB_RELEASE} AS pixelflux-legacy-builder
 FROM docker.io/library/ubuntu:${DISTRIB_RELEASE} AS pixelflux-legacy-builder
 
 
 ARG DEBIAN_FRONTEND=noninteractive
 ARG DEBIAN_FRONTEND=noninteractive
@@ -219,45 +223,30 @@ RUN apt-get update \
 
 
 WORKDIR /tmp/pixelflux
 WORKDIR /tmp/pixelflux
 
 
-RUN curl -fsSL \
+RUN set -eux; \
+    curl -fsSL \
         "https://codeload.github.com/linuxserver/pixelflux/tar.gz/refs/tags/${PIXELFLUX_VERSION}" \
         "https://codeload.github.com/linuxserver/pixelflux/tar.gz/refs/tags/${PIXELFLUX_VERSION}" \
-        -o /tmp/pixelflux.tar.gz \
-    && tar -xzf /tmp/pixelflux.tar.gz \
+        -o /tmp/pixelflux.tar.gz; \
+    tar -xzf /tmp/pixelflux.tar.gz \
         --strip-components=1 \
         --strip-components=1 \
-        -C /tmp/pixelflux \
-    && mkdir -p /out \
-    && test -f /usr/include/va/va.h \
-    && test -f /usr/include/va/va_drm.h \
-    && test -f /usr/include/libdrm/drm.h \
-    && pkg-config --exists libavcodec libavutil libva libdrm x11 xext xfixes \
-    && g++ \
-        -std=c++17 \
-        -Wno-unused-function \
-        -fPIC \
-        -O3 \
-        -flto \
-        -shared \
-        -Ipixelflux/include \
-        -o /out/screen_capture_module.so \
-        pixelflux/screen_capture_module.cpp \
-        pixelflux/include/xxhash.c \
-        -lX11 \
-        -lXext \
-        -lXfixes \
-        -ljpeg \
-        -lx264 \
-        -lyuv \
-        -ldl \
-        -lavcodec \
-        -lavutil \
-    && test -s /out/screen_capture_module.so \
-    && ! ldd /out/screen_capture_module.so | grep -q "not found"
-    && g++ \
+        -C /tmp/pixelflux; \
+    install -d -m 0755 /out; \
+    test -f /usr/include/va/va.h; \
+    test -f /usr/include/va/va_drm.h; \
+    test -f /usr/include/libdrm/drm.h; \
+    pkg-config --exists \
+        libavcodec \
+        libavutil \
+        libva \
+        libdrm \
+        x11 \
+        xext \
+        xfixes; \
+    g++ \
         -std=c++17 \
         -std=c++17 \
         -Wno-unused-function \
         -Wno-unused-function \
         -fPIC \
         -fPIC \
-        -O3 \
-        -flto \
+        -O2 \
         -shared \
         -shared \
         -Ipixelflux/include \
         -Ipixelflux/include \
         -o /out/screen_capture_module.so \
         -o /out/screen_capture_module.so \
@@ -271,8 +260,13 @@ RUN curl -fsSL \
         -lyuv \
         -lyuv \
         -ldl \
         -ldl \
         -lavcodec \
         -lavcodec \
-        -lavutil \
-    && test -s /out/screen_capture_module.so
+        -lavutil; \
+    test -s /out/screen_capture_module.so; \
+    ldd /out/screen_capture_module.so | tee /tmp/pixelflux-ldd.txt; \
+    if grep -q "not found" /tmp/pixelflux-ldd.txt; then \
+        echo "Missing Pixelflux shared-library dependency"; \
+        exit 1; \
+    fi
 
 
 # -----------------------------------------------------------------------------
 # -----------------------------------------------------------------------------
 # Final image
 # Final image
@@ -311,7 +305,7 @@ ENV TZ="${TZ}" \
     XDG_SESSION_TYPE="x11" \
     XDG_SESSION_TYPE="x11" \
     SELKIES_MODE="websockets" \
     SELKIES_MODE="websockets" \
     SELKIES_PORT="8081" \
     SELKIES_PORT="8081" \
-    SELKIES_ENCODER="h264enc" \
+    SELKIES_ENCODER="x264enc" \
     SELKIES_ENABLE_RESIZE="false" \
     SELKIES_ENABLE_RESIZE="false" \
     SELKIES_ENABLE_BASIC_AUTH="true" \
     SELKIES_ENABLE_BASIC_AUTH="true" \
     NVIDIA_VISIBLE_DEVICES="all" \
     NVIDIA_VISIBLE_DEVICES="all" \
@@ -512,6 +506,11 @@ RUN apt-get update \
         apache2-utils \
         apache2-utils \
         nginx \
         nginx \
         netcat-openbsd \
         netcat-openbsd \
+        libavcodec60 \
+        libavutil58 \
+        libjpeg-turbo8 \
+        libx264-164 \
+        libyuv0 \
     && apt-get clean \
     && apt-get clean \
     && rm -rf \
     && rm -rf \
         /var/lib/apt/lists/* \
         /var/lib/apt/lists/* \