1+ FROM rclone/rclone:beta AS rclone
12FROM ubuntu:noble AS builder
23ARG FFMPEG_VERSION="7.1"
34ARG RCLONE_VER="v1.69.1"
45ARG GO_VERSION="latest"
5- ARG GO_CRYPTO_VERSION="v0.35.0"
6- ARG GO_OAUTH2_VERSION="v0.27.0"
76
87USER root
98
@@ -20,33 +19,15 @@ RUN apt-get update -qqy \
2019 && apt-get -qyy clean \
2120 && mkdir -p /usr/local/src
2221
23- RUN if [ "${GO_VERSION}" = "latest" ]; then \
24- GO_VERSION=$(curl -sk https://go.dev/dl/?mode=json | jq -r '.[0].version' ); \
25- fi \
26- && curl -skLO https://go.dev/dl/${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz \
27- && tar -xf ${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz -C /usr/local \
28- && rm -rf ${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz* \
29- && ln -sf /usr/local/go/bin/go /usr/bin/go \
30- && go version
22+ COPY --from=rclone /usr/local/bin/rclone /usr/local/bin/rclone
3123
32- RUN cd /usr/local/src \
33- && git clone https://github.com/rclone/rclone.git \
34- && cd rclone \
35- && git checkout ${RCLONE_VER} \
36- # Patch deps version in go.mod to fix CVEs
37- && sed -i "s|golang.org/x/crypto v.*|golang.org/x/crypto ${GO_CRYPTO_VERSION}|g" go.mod \
38- && sed -i "s|golang.org/x/oauth2 v.*|golang.org/x/oauth2 ${GO_OAUTH2_VERSION}|g" go.mod \
39- && go mod tidy \
40- # Build rclone
41- && make \
42- && mv ~/go/bin/rclone /usr/local/bin/ \
43- && rclone version
24+ RUN rclone --version
4425
4526# ======================================
4627# Install x264 from source
4728# ======================================
4829RUN cd /usr/local/src \
49- && git clone https://code.videolan.org/videolan/x264.git \
30+ && git clone https://code.videolan.org/videolan/x264.git --filter=blob:none \
5031 && cd x264 \
5132 && ./configure --prefix="/usr/local" --enable-static \
5233 && make \
@@ -56,9 +37,9 @@ RUN cd /usr/local/src \
5637# Install FFmpeg from source
5738# ======================================
5839RUN cd /usr/local/src \
59- && git clone https://github.com/FFmpeg/FFmpeg.git \
40+ && git clone https://github.com/FFmpeg/FFmpeg.git --filter=blob:none \
6041 && cd FFmpeg \
61- && git checkout release/ ${FFMPEG_VERSION} \
42+ && git checkout n ${FFMPEG_VERSION} \
6243 && rm -rf .git \
6344 && PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" FFMPEG_VERSION=${FFMPEG_VERSION} ./configure \
6445 --prefix="/usr/local" \
0 commit comments