1
1
ARG NAMESPACE=selenium
2
2
ARG BASE=base
3
3
ARG VERSION=latest
4
- FROM ${NAMESPACE}/${BASE}:${VERSION} AS builder
5
- ARG VERSION_FFMPEG="7.1"
6
- ARG VERSION_RCLONE="v1.68.2"
7
- ARG VERSION_GO="1.23.3"
8
-
9
- USER root
10
-
11
- # ======================================
12
- # Install build tools
13
- # ======================================
14
- ARG TOOLS_DEPS="autoconf automake cmake libfreetype6 gcc build-essential libtool make nasm pkg-config zlib1g-dev numactl \
15
- libnuma-dev libx11-6 libxcb1 libxcb1-dev yasm git"
16
-
17
- RUN apt-get update -qqy \
18
- && apt-get -qqy --no-install-recommends install ${TOOLS_DEPS} \
19
- && apt-get -qyy clean \
20
- && mkdir -p /usr/local/src
21
-
22
- RUN curl -sLO https://go.dev/dl/go$VERSION_GO.linux-$(dpkg --print-architecture).tar.gz \
23
- && tar -xf go$VERSION_GO.linux-$(dpkg --print-architecture).tar.gz -C /usr/local \
24
- && rm -rf go$VERSION_GO.linux-$(dpkg --print-architecture).tar.gz* \
25
- && ln -sf /usr/local/go/bin/go /usr/bin/go \
26
- && go version
27
-
28
- RUN cd /usr/local/src \
29
- && git clone https://github.com/rclone/rclone.git \
30
- && cd rclone \
31
- && git checkout $VERSION_RCLONE \
32
- && make \
33
- && mv ~/go/bin/rclone /usr/local/bin/ \
34
- && rclone version
35
-
36
- # ======================================
37
- # Install x264 from source
38
- # ======================================
39
- RUN cd /usr/local/src \
40
- && git clone https://code.videolan.org/videolan/x264.git \
41
- && cd x264 \
42
- && ./configure --prefix="/usr/local" --enable-static \
43
- && make \
44
- && make install
45
-
46
- # ======================================
47
- # Install FFmpeg from source
48
- # ======================================
49
- RUN cd /usr/local/src \
50
- && git clone https://github.com/FFmpeg/FFmpeg.git \
51
- && cd FFmpeg \
52
- && git checkout release/$VERSION_FFMPEG \
53
- && PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \
54
- --prefix="/usr/local" \
55
- --extra-cflags="-I/usr/local/include" \
56
- --extra-ldflags="-L/usr/local/lib" \
57
- --pkg-config-flags="--static" \
58
- --enable-gpl \
59
- --enable-nonfree \
60
- --enable-libx264 \
61
- --enable-libxcb \
62
- && make \
63
- && make install
64
-
65
- RUN rm -rf /usr/local/src/* \
66
- && rm -rf /usr/local/go \
67
- && apt-get remove -y ${TOOLS_DEPS} \
68
- && apt-get -qyy autoremove
4
+ ARG FFMPEG_BASED_NAME=selenium
5
+ ARG FFMPEG_BASED_TAG=latest
6
+ FROM ${FFMPEG_BASED_NAME}/ffmpeg:${FFMPEG_BASED_TAG} AS source
69
7
70
8
# Final stage
71
9
FROM ${NAMESPACE}/${BASE}:${VERSION}
@@ -74,27 +12,29 @@ LABEL authors=${AUTHORS}
74
12
75
13
USER root
76
14
77
- COPY --from=builder /usr/local /usr/local
15
+ COPY --from=source /usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
16
+ COPY --from=source /usr/local/bin/rclone /usr/local/bin/rclone
78
17
79
18
RUN apt-get -qqy update \
80
19
&& apt-get -qqy --no-install-recommends install \
81
20
libx11-6 libxcb1 libxcb-shm0 \
82
- x11-xserver-utils x11-utils python3-psutil \
83
- && pip install --no-cache-dir --upgrade --break-system-packages setuptools \
21
+ x11-xserver-utils x11-utils \
22
+ python3-pip \
23
+ && pip install --break-system-packages --no-cache-dir setuptools psutil \
84
24
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/*
85
25
86
26
COPY *.conf /etc/supervisor/conf.d/
87
27
COPY --chown="${SEL_UID}:${SEL_GID}" *.sh video_ready.py /opt/bin/
88
28
89
29
USER ${SEL_UID}
90
30
91
- RUN ldd /usr/local/bin/ffmpeg \
92
- && /usr/local/bin/ffmpeg -version \
31
+ RUN ffmpeg -version \
93
32
&& rclone --version \
94
33
&& touch /opt/selenium/upload.conf
95
34
96
35
ENV DISPLAY_NUM=99 \
97
36
DISPLAY_CONTAINER_NAME="selenium" \
37
+ SE_RECORD_VIDEO=true \
98
38
SE_SERVER_PROTOCOL="http" \
99
39
SE_VIDEO_POLL_INTERVAL=1 \
100
40
SE_SCREEN_WIDTH=1920 \
0 commit comments