-
Notifications
You must be signed in to change notification settings - Fork 39
/
Dockerfile.aarch64
120 lines (112 loc) · 3.15 KB
/
Dockerfile.aarch64
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
##############################################################################
# Source: https://github.com/linuxserver/docker-baseimage-alpine-python3/blob/master/Dockerfile
# Simply using it as a baseimage fails:
# - installing g++ fails (baseimage already installs it and purges it afterwards, so let's keep it)
# - installing python 3.7.3 because that is what py3-libtorrent-rasterbar requires (doesn't work with 3.6.8)
FROM lsiobase/alpine:arm64v8-3.10
RUN apk add \
libxml2-dev \
libxslt-dev \
python3 \
python3-dev \
py3-lxml \
boost-python3 \
bash && \
echo "**** install alpine sdk so that we can build libtorrent python bindings (for various plugin) ****" && \
apk add alpine-sdk && \
abuild-keygen -ian && \
usermod -aG abuild root
RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
autoconf \
automake \
freetype-dev \
g++ \
gcc \
jpeg-dev \
lcms2-dev \
libffi-dev \
libpng-dev \
libwebp-dev \
linux-headers \
make \
openjpeg-dev \
openssl-dev \
tiff-dev \
zlib-dev && \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
freetype \
git \
lcms2 \
libjpeg-turbo \
libwebp \
openjpeg \
openssl \
p7zip \
tar \
tiff \
unrar \
unzip \
vnstat \
wget \
xz \
zlib && \
echo "**** use ensure to check for pip and link /usr/bin/pip3 to /usr/bin/pip ****" && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
if \
[ ! -e /usr/bin/pip ]; then \
ln -s /usr/bin/pip3 /usr/bin/pip ; fi && \
echo "**** install pip packages ****" && \
pip install --no-cache-dir -U \
pip \
setuptools && \
pip install -U \
configparser \
ndg-httpsclient \
notify \
paramiko \
pillow \
psutil \
pyopenssl \
requests \
setuptools \
urllib3 \
virtualenv && \
echo "**** build libtorrent-rasterbar, this takes a bit ****" && \
mkdir -p /build/py3-libtorrent-rasterbar && \
cd /build/py3-libtorrent-rasterbar && \
wget https://git.alpinelinux.org/aports/plain/testing/libtorrent-rasterbar/APKBUILD && \
abuild -F checksum && abuild -Fr && \
apk add --repository /root/packages/build py3-libtorrent-rasterbar && \
echo "**** clean up ****" && \
rm -rf \
/root/.cache \
/tmp/* \
/build \
/root/packages
##############################################################################
# Here starts the usual changes compared to baseimage.
ENV S6_BEHAVIOUR_IF_STAGE2_FAILS="2"
# Set python to use utf-8 rather than ascii.
# Also, for python3: https://bugs.python.org/issue19846
ENV LANG C.UTF-8
# Copy local files.
COPY etc/ /etc
RUN chmod -v +x \
/etc/cont-init.d/* \
/etc/services.d/*/run
COPY requirements.txt /
# Ports and volumes.
EXPOSE 5050/tcp
VOLUME /config
# Flexget looks for config.yml automatically inside:
# /root/.flexget, /root/.config/flexget
# Since the uid/gid for user abc can be changed on the fly, set 777.
RUN CONFIG_SYMLINK_DIR=/root \
&& ln -s /config "$CONFIG_SYMLINK_DIR/.flexget" \
&& chmod 777 "$CONFIG_SYMLINK_DIR/" \
&& chmod 777 "$CONFIG_SYMLINK_DIR/.flexget/"