forked from jellyfin/jellyfin-ffmpeg
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.in
54 lines (45 loc) · 1.99 KB
/
Dockerfile.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
FROM DISTRO
# Docker build arguments
ARG SOURCE_DIR=/ffmpeg
ARG ARTIFACT_DIR=/dist
# Docker run environment
ENV DEB_BUILD_OPTIONS=noddebs
ENV DEBIAN_FRONTEND=noninteractive
ENV ARCH=BUILD_ARCHITECTURE
ENV GCC_VER=GCC_RELEASE_VERSION
ENV LLVM_VER=LLVM_RELEASE_VERSION
ENV SOURCE_DIR=/ffmpeg
ENV ARTIFACT_DIR=/dist
ENV TARGET_DIR=/usr/lib/jellyfin-ffmpeg
ENV DPKG_INSTALL_LIST=${SOURCE_DIR}/debian/jellyfin-ffmpeg7.install
ENV PATH=${TARGET_DIR}/bin:${PATH}
ENV PKG_CONFIG_PATH=${TARGET_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH}
ENV LD_LIBRARY_PATH=${TARGET_DIR}/lib:${TARGET_DIR}/lib/mfx:${TARGET_DIR}/lib/xorg:${LD_LIBRARY_PATH}
ENV LDFLAGS="-Wl,-rpath=${TARGET_DIR}/lib -L${TARGET_DIR}/lib"
ENV CXXFLAGS="-I${TARGET_DIR}/include $CXXFLAGS"
ENV CPPFLAGS="-I${TARGET_DIR}/include $CPPFLAGS"
ENV CFLAGS="-I${TARGET_DIR}/include $CFLAGS"
# Prepare Debian build environment
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get install -y apt-transport-https \
curl ninja-build debhelper gnupg wget devscripts \
mmv equivs git nasm pkg-config subversion dh-autoreconf \
libpciaccess-dev libwayland-dev libx11-dev libx11-xcb-dev \
libxcb-dri2-0-dev libxcb-dri3-dev libxcb-present-dev \
libxcb-shm0-dev libxcb-sync-dev libxshmfence-dev libxext-dev \
libxfixes-dev libxcb1-dev libxrandr-dev libzstd-dev \
libelf-dev python3-pip zip unzip tar flex bison gperf ragel \
&& apt-get clean autoclean -y \
&& apt-get autoremove -y
# Install newer tools from pip3
RUN pip3 install $(pip3 help install | grep -o "\-\-break-system-packages") --ignore-installed pip \
&& pip3 install $(pip3 help install | grep -o "\-\-break-system-packages") meson cmake mako jinja2
# Avoids timeouts when using git and disable the detachedHead advice
RUN git config --global http.postbuffer 524288000 \
&& git config --global advice.detachedHead false
# Link to docker-build script
RUN ln -sf ${SOURCE_DIR}/docker-build.sh /docker-build.sh
VOLUME ${ARTIFACT_DIR}/
COPY . ${SOURCE_DIR}/
ENTRYPOINT ["/docker-build.sh"]