Skip to content

Commit 8e119da

Browse files
committed
Docker: Use curl static binary
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent f0ab6c9 commit 8e119da

2 files changed

Lines changed: 16 additions & 26 deletions

File tree

.ffmpeg/Dockerfile

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
FROM rclone/rclone:beta AS rclone
12
FROM ubuntu:noble AS builder
23
ARG FFMPEG_VERSION="7.1"
34
ARG RCLONE_VER="v1.69.1"
45
ARG GO_VERSION="latest"
5-
ARG GO_CRYPTO_VERSION="v0.35.0"
6-
ARG GO_OAUTH2_VERSION="v0.27.0"
76

87
USER 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
#======================================
4829
RUN 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
#======================================
5839
RUN 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" \

Base/Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ ENV DEBIAN_FRONTEND=noninteractive \
4545
# Miscellaneous packages
4646
# Includes minimal runtime used for executing non GUI Java programs
4747
#========================
48+
RUN echo "deb [arch=amd64] http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse\n" > /etc/apt/sources.list \
49+
&& echo "deb-src [arch=amd64] http://archive.ubuntu.com/ubuntu noble main restricted universe multiverse\n" >> /etc/apt/sources.list \
50+
&& echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" >> /etc/apt/sources.list \
51+
&& echo "deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports noble main restricted universe multiverse" >> /etc/apt/sources.list
52+
4853
RUN apt-get -qqy update \
4954
&& apt-get upgrade -yq \
5055
&& apt-get -qqy --no-install-recommends install \
@@ -56,14 +61,18 @@ RUN apt-get -qqy update \
5661
unzip \
5762
wget \
5863
jq \
59-
curl \
6064
supervisor \
6165
gnupg2 \
6266
libnss3-tools \
6367
openjdk-${JRE_VERSION}-jdk-headless \
6468
ca-certificates \
6569
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
6670

71+
RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "arm64" ]; then echo "aarch64"; else echo "$(dpkg --print-architecture)"; fi) \
72+
&& wget -q https://github.com/moparisthebest/static-curl/releases/download/v8.11.0/curl-$ARCH -O /usr/bin/curl \
73+
&& chmod +x /usr/bin/curl \
74+
&& curl --version
75+
6776
RUN --mount=type=secret,id=SEL_PASSWD \
6877
if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" = "v7" ]; then \
6978
export ARCH=armhf ; \

0 commit comments

Comments
 (0)