|
| 1 | +FROM ubuntu:noble AS builder |
| 2 | +ARG VERSION_FFMPEG="7.1" |
| 3 | +ARG VERSION_RCLONE="v1.68.2" |
| 4 | +ARG VERSION_GO="latest" |
| 5 | + |
| 6 | +USER root |
| 7 | + |
| 8 | +#====================================== |
| 9 | +# Install build tools |
| 10 | +#====================================== |
| 11 | +ARG TOOLS_DEPS="autoconf automake cmake libfreetype6 gcc build-essential libtool make nasm pkg-config zlib1g-dev numactl \ |
| 12 | +libnuma-dev libx11-6 libxcb1 libxcb1-dev yasm git curl jq wget ca-certificates" |
| 13 | + |
| 14 | +RUN apt-get update -qqy \ |
| 15 | + && apt-get upgrade -yq \ |
| 16 | + && apt-get -qqy --no-install-recommends install ${TOOLS_DEPS} \ |
| 17 | + && apt-get -qyy clean \ |
| 18 | + && mkdir -p /usr/local/src |
| 19 | + |
| 20 | +RUN if [ "${VERSION_GO}" = "latest" ]; then \ |
| 21 | + VERSION_GO=$(curl -sk https://go.dev/dl/?mode=json | jq -r '.[0].version'); \ |
| 22 | + fi \ |
| 23 | + && curl -skLO https://go.dev/dl/$VERSION_GO.linux-$(dpkg --print-architecture).tar.gz \ |
| 24 | + && tar -xf $VERSION_GO.linux-$(dpkg --print-architecture).tar.gz -C /usr/local \ |
| 25 | + && rm -rf $VERSION_GO.linux-$(dpkg --print-architecture).tar.gz* \ |
| 26 | + && ln -sf /usr/local/go/bin/go /usr/bin/go \ |
| 27 | + && go version |
| 28 | + |
| 29 | +RUN cd /usr/local/src \ |
| 30 | + && git clone https://github.com/rclone/rclone.git \ |
| 31 | + && cd rclone \ |
| 32 | + && git checkout $VERSION_RCLONE \ |
| 33 | + && make \ |
| 34 | + && mv ~/go/bin/rclone /usr/local/bin/ \ |
| 35 | + && rclone version |
| 36 | + |
| 37 | +#====================================== |
| 38 | +# Install x264 from source |
| 39 | +#====================================== |
| 40 | +RUN cd /usr/local/src \ |
| 41 | + && git clone https://code.videolan.org/videolan/x264.git \ |
| 42 | + && cd x264 \ |
| 43 | + && ./configure --prefix="/usr/local" --enable-static \ |
| 44 | + && make \ |
| 45 | + && make install |
| 46 | + |
| 47 | +#====================================== |
| 48 | +# Install FFmpeg from source |
| 49 | +#====================================== |
| 50 | +RUN cd /usr/local/src \ |
| 51 | + && git clone https://github.com/FFmpeg/FFmpeg.git \ |
| 52 | + && cd FFmpeg \ |
| 53 | + && git checkout release/$VERSION_FFMPEG \ |
| 54 | + && PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \ |
| 55 | + --prefix="/usr/local" \ |
| 56 | + --extra-cflags="-I/usr/local/include" \ |
| 57 | + --extra-ldflags="-L/usr/local/lib" \ |
| 58 | + --pkg-config-flags="--static" \ |
| 59 | + --enable-gpl \ |
| 60 | + --enable-nonfree \ |
| 61 | + --enable-libx264 \ |
| 62 | + --enable-libxcb \ |
| 63 | + --enable-static \ |
| 64 | + && make \ |
| 65 | + && make install |
| 66 | + |
| 67 | +# Final stage |
| 68 | +FROM ubuntu:noble |
| 69 | + |
| 70 | +USER root |
| 71 | + |
| 72 | +COPY --from=builder /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg |
| 73 | +COPY --from=builder /usr/local/bin/rclone /usr/local/bin/rclone |
| 74 | + |
| 75 | +RUN apt-get -qqy update \ |
| 76 | + && apt-get -qqy --no-install-recommends install \ |
| 77 | + libx11-dev libxcb1 libxcb-shm0 \ |
| 78 | + && rm -rf /var/lib/apt/lists/* /var/cache/apt/* |
| 79 | + |
| 80 | +RUN ffmpeg -version \ |
| 81 | + && rclone --version |
0 commit comments