From 6eb7ff98070ba9a554174785b76c096cb3336c88 Mon Sep 17 00:00:00 2001 From: Kieran Date: Thu, 19 Jun 2025 13:32:41 +0100 Subject: [PATCH] chore: use rust-ffmpeg docker image --- .dockerignore | 3 +-- crates/zap-stream/Dockerfile | 37 +++--------------------------------- 2 files changed, 4 insertions(+), 36 deletions(-) diff --git a/.dockerignore b/.dockerignore index 5aeb0b4..224a94a 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ **/target/ **/.git/ -**/out/ -**/Dockerfile \ No newline at end of file +**/out/ \ No newline at end of file diff --git a/crates/zap-stream/Dockerfile b/crates/zap-stream/Dockerfile index 998191e..5a003f5 100755 --- a/crates/zap-stream/Dockerfile +++ b/crates/zap-stream/Dockerfile @@ -1,46 +1,15 @@ -ARG IMAGE=rust:bookworm - -FROM $IMAGE AS build +FROM voidic/rust-ffmpeg AS build WORKDIR /app/src -ENV FFMPEG_DIR=/app/ffmpeg COPY . . -RUN apt update && \ - apt install -y \ - build-essential \ - libx264-dev \ - libx265-dev \ - libwebp-dev \ - libpng-dev \ - nasm \ - protobuf-compiler \ - libclang-dev && \ - rm -rf /var/lib/apt/lists/* -RUN wget -O ffmpeg.tar.gz https://git.v0l.io/ffmpeg/ffmpeg/archive/release/7.1.tar.gz && \ - tar xfv ffmpeg.tar.gz && \ - cd ffmpeg && \ - ./configure \ - --prefix=$FFMPEG_DIR \ - --disable-programs \ - --disable-doc \ - --disable-network \ - --enable-gpl \ - --enable-version3 \ - --disable-postproc \ - --enable-libx264 \ - --enable-libx265 \ - --enable-libwebp \ - --disable-static \ - --enable-shared && \ - make -j$(nproc) && make install ENV LD_LIBRARY_PATH=$FFMPEG_DIR/lib RUN cargo test RUN cargo install --path ./crates/zap-stream --root /app/build -FROM $IMAGE AS runner +FROM rust:bookworm WORKDIR /app RUN apt update && \ apt install -y libx264-164 && \ rm -rf /var/lib/apt/lists/* COPY --from=build /app/build . -COPY --from=build /app/ffmpeg/lib/ /lib +COPY --from=build /app/src/ffmpeg/lib/ /lib ENTRYPOINT ["/app/bin/zap-stream"] \ No newline at end of file