-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile.17x
170 lines (136 loc) · 4.54 KB
/
Dockerfile.17x
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
FROM ubuntu:22.04 AS builder
MAINTAINER zocker-160
ENV HANDBRAKE_VERSION_TAG 1.7.3
ENV HANDBRAKE_VERSION_BRANCH 1.7.x
ENV HANDBRAKE_DEBUG_MODE none
ENV HANDBRAKE_URL https://api.github.com/repos/HandBrake/HandBrake/releases/tags/$HANDBRAKE_VERSION
ENV HANDBRAKE_URL_GIT https://github.com/HandBrake/HandBrake.git
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /HB
## Prepare
RUN apt-get update
RUN apt-get install -y \
curl diffutils file coreutils m4 xz-utils nasm python3 python3-pip appstream software-properties-common
## Build dependencies
RUN apt-get install -y \
autoconf automake build-essential cmake git libass-dev libbz2-dev libfontconfig-dev libfreetype-dev libfribidi-dev libharfbuzz-dev libjansson-dev liblzma-dev libmp3lame-dev libnuma-dev libogg-dev libopus-dev libsamplerate0-dev libspeex-dev libtheora-dev libtool libtool-bin libturbojpeg0-dev libvorbis-dev libx264-dev libxml2-dev libvpx-dev m4 make meson nasm ninja-build patch pkg-config tar zlib1g-dev
## Intel CSV dependencies
RUN apt-get install -y libva-dev libdrm-dev
## GTK GUI dependencies
RUN apt-get install -y \
appstream desktop-file-utils gettext gstreamer1.0-libav gstreamer1.0-plugins-good libgstreamer-plugins-base1.0-dev libgtk-3-dev
## Install clang
RUN apt-get install -y clang
## Install meson from pip
RUN pip3 install -U meson
## Download HandBrake sources
RUN echo "Downloading HandBrake sources..."
RUN git clone $HANDBRAKE_URL_GIT --branch $HANDBRAKE_VERSION_TAG
## Compile HandBrake
WORKDIR /HB/HandBrake
RUN ./scripts/repo-info.sh > version.txt
RUN echo "Compiling HandBrake..."
RUN ./configure --prefix=/usr/local \
--debug=$HANDBRAKE_DEBUG_MODE \
--enable-fdk-aac \
--enable-x265 \
--enable-numa \
--enable-qsv \
--enable-nvenc \
--enable-nvdec \
--launch-jobs=$(nproc) \
--launch
RUN make -j$(nproc) --directory=build install
##########################################################################################
## Pull base image
FROM jlesage/baseimage-gui:ubuntu-22.04-v4
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES all
ENV DEBIAN_FRONTEND noninteractive
ENV APP_NAME="HandBrake"
ENV AUTOMATED_CONVERSION_PRESET="Very Fast 1080p30"
ENV AUTOMATED_CONVERSION_FORMAT="mp4"
## URLs
ENV APP_ICON_URL https://raw.githubusercontent.com/jlesage/docker-templates/master/jlesage/images/handbrake-icon.png
ENV DVDCSS_NAME libdvd-pkg_1.4.3-1-1_all.deb
ENV DVDCSS_URL http://ftp.br.debian.org/debian/pool/contrib/libd/libdvd-pkg/$DVDCSS_NAME
WORKDIR /tmp
## Runtime dependencies
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
# For optical drive listing:
lsscsi \
# For watchfolder
bash \
coreutils \
yad \
findutils \
expect \
tcl8.6 \
wget \
git
## Handbrake dependencies
RUN apt-get install -y \
gstreamer1.0-libav \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-fdkaac \
libass9 \
libavcodec-extra58 \
libavfilter-extra7 \
libavformat58 \
libavutil56 \
libbluray2 \
libc6 \
libcairo2 \
libdvdnav4 \
libdvdread8 \
libgdk-pixbuf2.0-0 \
libglib2.0-0 \
libgtk-3-0 \
libgudev-1.0-0 \
libjansson4 \
libpango-1.0-0 \
libsamplerate0 \
libswresample3 \
libswscale5 \
libtheora0 \
libvorbis0a \
libvorbisenc2 \
libx264-163 \
libx265-199 \
libxml2 \
libturbojpeg
## To read encrypted DVDs install libdvdcss
RUN wget $DVDCSS_URL
RUN apt-get install -y ./$DVDCSS_NAME
RUN rm $DVDCSS_NAME
## install scripts and stuff from upstream Handbrake docker image
RUN git config --global http.sslVerify false
RUN git clone https://github.com/jlesage/docker-handbrake.git --branch v24.01.2
RUN cp -r docker-handbrake/rootfs/* /
## Cleanup
RUN rm -rf docker-handbrake
RUN apt-get remove wget git -y && \
apt-get autoremove -y && \
apt-get autoclean -y && \
apt-get clean -y && \
apt-get purge -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
## Generate and install favicons
RUN apt-get update
RUN install_app_icon.sh "$APP_ICON_URL"
RUN \
apt-get autoremove -y && \
apt-get autoclean -y && \
apt-get clean -y && \
apt-get purge -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Copy HandBrake from base build image
COPY --from=builder /usr/local /usr
RUN set-cont-env APP_NAME "HandBrake ${HANDBRAKE_VERSION_TAG}"
# Define mountable directories
VOLUME ["/config"]
VOLUME ["/storage"]
VOLUME ["/output"]
VOLUME ["/watch"]