1
1
FROM ubuntu:noble AS builder
2
- ARG VERSION_FFMPEG ="7.1"
3
- ARG VERSION_RCLONE ="v1.68.2"
4
- ARG VERSION_GO ="latest"
2
+ ARG FFMPEG_VERSION ="7.1"
3
+ ARG RCLONE_VER ="v1.68.2"
4
+ ARG GO_VERSION ="latest"
5
5
ARG GO_CRYPTO_VERSION="v0.31.0"
6
6
ARG GO_NET_VERSION="v0.33.0"
7
7
@@ -19,19 +19,19 @@ RUN apt-get update -qqy \
19
19
&& apt-get -qyy clean \
20
20
&& mkdir -p /usr/local/src
21
21
22
- RUN if [ "${VERSION_GO }" = "latest" ]; then \
23
- VERSION_GO =$(curl -sk https://go.dev/dl/?mode=json | jq -r '.[0].version' ); \
22
+ RUN if [ "${GO_VERSION }" = "latest" ]; then \
23
+ GO_VERSION =$(curl -sk https://go.dev/dl/?mode=json | jq -r '.[0].version' ); \
24
24
fi \
25
- && curl -skLO https://go.dev/dl/$VERSION_GO .linux-$(dpkg --print-architecture).tar.gz \
26
- && tar -xf $VERSION_GO .linux-$(dpkg --print-architecture).tar.gz -C /usr/local \
27
- && rm -rf $VERSION_GO .linux-$(dpkg --print-architecture).tar.gz* \
25
+ && curl -skLO https://go.dev/dl/${GO_VERSION} .linux-$(dpkg --print-architecture).tar.gz \
26
+ && tar -xf ${GO_VERSION} .linux-$(dpkg --print-architecture).tar.gz -C /usr/local \
27
+ && rm -rf ${GO_VERSION} .linux-$(dpkg --print-architecture).tar.gz* \
28
28
&& ln -sf /usr/local/go/bin/go /usr/bin/go \
29
29
&& go version
30
30
31
31
RUN cd /usr/local/src \
32
32
&& git clone https://github.com/rclone/rclone.git \
33
33
&& cd rclone \
34
- && git checkout $VERSION_RCLONE \
34
+ && git checkout ${RCLONE_VER} \
35
35
# Patch deps version in go.mod to fix CVEs
36
36
&& sed -i "s|golang.org/x/crypto v.*|golang.org/x/crypto ${GO_CRYPTO_VERSION}|g" go.mod \
37
37
&& sed -i "s|golang.org/x/net v.*|golang.org/x/net ${GO_NET_VERSION}|g" go.mod \
@@ -57,8 +57,9 @@ RUN cd /usr/local/src \
57
57
RUN cd /usr/local/src \
58
58
&& git clone https://github.com/FFmpeg/FFmpeg.git \
59
59
&& cd FFmpeg \
60
- && git checkout release/$VERSION_FFMPEG \
61
- && PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \
60
+ && git checkout release/${FFMPEG_VERSION} \
61
+ && rm -rf .git \
62
+ && PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" FFMPEG_VERSION=${FFMPEG_VERSION} ./configure \
62
63
--prefix="/usr/local" \
63
64
--extra-cflags="-I/usr/local/include" \
64
65
--extra-ldflags="-L/usr/local/lib" \
@@ -87,3 +88,5 @@ RUN apt-get -qqy update \
87
88
RUN ldd /usr/local/bin/ffmpeg \
88
89
&& ffmpeg -version \
89
90
&& rclone --version
91
+
92
+ USER 101
0 commit comments