@@ -14,7 +14,7 @@ RUN apt-get update && \
1414 apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev \
1515 libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
1616 xz-utils tk-dev libffi-dev liblzma-dev python3-openssl git runit libzmq3-dev && \
17- rm -rf /var/lib/apt/lists/*
17+ apt-get clean && rm -rf /var/lib/apt/lists/*
1818
1919# Keep python installation from base image
2020
@@ -23,7 +23,7 @@ RUN apt-get update && \
2323RUN apt-get update && apt-get install -y --no-install-recommends \
2424 autoconf automake build-essential cmake git-core libtool pkg-config wget \
2525 nasm yasm zlib1g-dev libpng-dev libx264-dev libopus-dev libfdk-aac-dev && \
26- rm -rf /var/lib/apt/lists/*
26+ apt-get clean && rm -rf /var/lib/apt/lists/*
2727
2828# Set up environment variables
2929ENV NV_CODEC_HEADERS=/usr/local/cuda/include/ffnvcodec/
@@ -34,10 +34,9 @@ RUN git clone -b n12.2.72.0 --depth 1 https://git.videolan.org/git/ffmpeg/nv-cod
3434 cd .. && rm -rf nv-codec-headers
3535
3636# Clone the FFmpeg repository and checkout the latest release
37- RUN git clone --branch n7.1 --depth 1 https://github.com/FFmpeg/FFmpeg.git ffmpeg
38-
39- # Build FFmpeg with shared libraries and hardware acceleration
40- RUN cd ffmpeg && \
37+ RUN git clone --branch n7.1 --depth 1 https://github.com/FFmpeg/FFmpeg.git ffmpeg && \
38+ # Build FFmpeg with static linking and the desired hardware-accelerated features
39+ cd ffmpeg && \
4140 ./configure --prefix=/compiled \
4241 --extra-cflags="-I/ffmpeg_build/include -I/usr/local/cuda/include" \
4342 --extra-ldflags="-L/ffmpeg_build/lib -L/usr/local/cuda/lib64" \
@@ -58,13 +57,11 @@ RUN cd ffmpeg && \
5857 --disable-doc && \
5958 make -j$(nproc) && \
6059 make install && \
61- make distclean
62-
63- # Copy the compiled FFmpeg binaries to /usr/local
64- RUN cp -R /compiled/* /usr/local/
65-
66- # Clean up APT cache to reduce image size
67- RUN apt-get clean && rm -rf /var/lib/apt/lists/*
60+ make distclean && \
61+ # Copy the compiled FFmpeg binaries to /usr/local
62+ cp -R /compiled/* /usr/local/ && \
63+ cd .. \
64+ rm -rf ffmpeg
6865
6966# -----------------------------------------------------------------------------
7067# live-base: End of section
0 commit comments