-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
100 lines (91 loc) · 3.39 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
FROM debian:bullseye-slim
# I just don't understand anything about all of these fucking "slim-image"
# WinRAR binaries aren't compatible with Alpine and pyautorescene code don't work with setup.py and other things like this with more recent python version
# Install dependencies and Python 3.9
RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y \
wget \
unzip \
ca-certificates \
build-essential \
zlib1g-dev \
libstdc++6 \
libgcc-s1 \
python3.9 \
python3.9-distutils \
python3.9-venv \
python3-pip \
# We need 32 bit binaries for some RAR version
libc6-i386 \
libstdc++5 \
libstdc++5:i386 \
lib32stdc++6 \
lib32z1 \
lib32ncurses6 \
# We need this for srs .NET 1.2
mono-complete \
&& \
apt-get clean && \
# We need this for very old RAR version
wget http://archive.debian.org/debian/pool/main/g/gcc-2.95/libstdc++2.10-glibc2.2_2.95.4-27_i386.deb && \
dpkg -i libstdc++2.10-glibc2.2_2.95.4-27_i386.deb && \
rm -rf /var/lib/apt/lists/* && \
rm -rf libstdc++2.10-glibc2.2_2.95.4-27_i386.deb && \
mkdir -p /app /app/rarv /app/rarv/tmp /input /output /srr
WORKDIR /app
# YOU NEED TO EDIT THIS WITH YOURS
RUN USER="" && \
PASS="" && \
RAR="/app/rarv" && \
TEMP="/tmp" && \
# 1 - Install unrar from source
wget https://www.rarlab.com/rar/unrarsrc-7.0.9.tar.gz && \
tar xzf unrarsrc-7.0.9.tar.gz && \
cd unrar && \
make && \
make install && \
cd .. && \
# Clean up build dependencies
apt-get remove --purge -y \
build-essential \
zlib1g-dev \
&& \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /app/unrarsrc-7.0.9.tar.gz /app/unrar && \
# 2 - Set up pyrescene
wget https://github.com/srrDB/pyrescene/archive/refs/heads/master.zip && \
unzip master.zip && \
cd pyrescene-master && \
python3 setup.py install && \
cd .. && \
rm -rf master.zip && \
# 3 - Set up rarlinux
wget https://github.com/jaloji/rarlinux/archive/refs/heads/master.zip && \
unzip -o master.zip && \
# More version avaiblable with x86
python3 /app/pyrescene-master/bin/preprardir.py -b /app/rarlinux-master/x86 /app/rarv/ && \
rm -rf master.zip && \
# 4 - Set up pyautorescene
wget https://github.com/jaloji/pyautorescene/archive/refs/heads/master.zip && \
unzip -o master.zip && \
cd pyautorescene-master && \
sed -i 's%RAR_VERSION = "".*%RAR_VERSION = "'"$RAR"'"%' /app/pyautorescene-master/utils/res.py && \
sed -i 's%SRR_TEMP_FOLDER = f"{RAR_VERSION}"%SRR_TEMP_FOLDER = f"{RAR_VERSION}'"$TEMP"'"%' /app/pyautorescene-master/utils/res.py && \
sed -i "s/USERNAME = \"\"/USERNAME=\"$USER\"/" /app/pyautorescene-master/utils/res.py && \
sed -i "s/PASSWORD = \"\"/PASSWORD=\"$PASS\"/" /app/pyautorescene-master/utils/res.py && \
python3 setup.py install && \
cd .. && \
rm -rf master.zip
# YES WE DONT ADDUSER ADDSHIT
# I don't give a shit about docker rules its pissed me off to delete them to update this docker when something wrong
# If you want them FORK IT !
ENV UID=1000 \
GID=1000
# Set working directory and user
WORKDIR /input
# Uncomment for single use
#CMD ["autorescene.py", "-vaf", "-o", "/output/", "/input/"]
# Or
#CMD ["srrup.py", "/srr"]