forked from Jeeaaasus/youtube-dl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
79 lines (69 loc) · 2.11 KB
/
Dockerfile
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
FROM debian:11-slim
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS="2" \
PUID="911" \
PGID="911" \
youtubedl_debug="false" \
youtubedl_lockfile="false" \
youtubedl_webui="false" \
youtubedl_webuiport="8080" \
youtubedl_cookies="false" \
youtubedl_watchlater="false" \
youtubedl_interval="3h" \
youtubedl_quality="1080"
RUN set -x && \
addgroup --gid "$PGID" abc && \
adduser \
--gecos "" \
--disabled-password \
--no-create-home \
--uid "$PUID" \
--ingroup abc \
--shell /bin/bash \
abc
COPY root/ /
RUN set -x && \
apt update && \
apt install -y \
wget \
python3 \
python3-pip && \
apt clean && \
python3 -m pip --no-cache-dir install -r /app/requirements.txt && \
rm -rf \
/var/lib/apt/lists/* \
-rf /tmp/* \
/app/requirements.txt
RUN set -x && \
ARCH=`uname -m` && \
if [ "$ARCH" = "x86_64" ]; then \
wget -q $(wget -q https://api.github.com/repos/yt-dlp/FFmpeg-Builds/releases/latest -O - | grep -ioE 'https://github.com/yt-dlp/FFmpeg-Builds/releases/download/.*?ffmpeg-n-.*?-linux64-gpl.tar.xz') -O - | tar -xJ -C /tmp/ && \
chmod -R a+x $(find /tmp/ffmpeg*/bin/ -type d) && \
mv $(find /tmp/ffmpeg*/bin/ -type d)/* /usr/local/bin/ && \
rm -rf /tmp/* ; \
else \
apt update && \
apt install -y \
ffmpeg && \
apt clean && \
rm -rf \
/var/lib/apt/lists/* \
-rf /tmp/* ; \
fi
RUN set -ex && \
ARCH=`uname -m` && \
if [ "$ARCH" = "x86_64" ]; then \
s6_package="s6-overlay-amd64.tar.gz" ; \
elif [ "$ARCH" = "aarch64" ]; then \
s6_package="s6-overlay-aarch64.tar.gz" ; \
else \
echo "unknown arch: ${ARCH}" && \
exit 1 ; \
fi && \
wget -P /tmp/ https://github.com/just-containers/s6-overlay/releases/latest/download/${s6_package} && \
tar -xzf /tmp/${s6_package} -C / && \
rm -rf /tmp/*
RUN set -x && \
python3 -m pip --no-cache-dir install yt-dlp
VOLUME /config /downloads
WORKDIR /config
ENTRYPOINT ["/init"]