This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
139 lines (125 loc) · 3.13 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
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
# Use a specific base image
FROM python:3.11-alpine as build
# Set working directory
WORKDIR /home/sdk/
# Update and install packages
RUN apk update && apk upgrade && \
apk add --upgrade --no-cache \
apache2-utils \
autoconf \
automake \
bash \
boost-dev \
busybox \
c-ares-dev \
ca-certificates \
ccache \
clang \
clang-dev \
coreutils \
crypto++ \
crypto++-dev \
curl \
curl-dev \
g++ \
gcc \
gawk \
gettext \
gettext-dev \
git \
icu-data-full \
jq \
libc-dev \
libffi \
libffi-dev \
libjpeg-turbo-dev \
libmagic \
libpq-dev \
libpthread-stubs \
libtool \
libsodium-dev \
linux-headers \
lshw \
make \
mediainfo \
musl \
musl-dev \
musl-locales \
musl-utils \
openssl-dev \
parallel \
py3-setuptools \
py3-wheel \
python3-dev \
sqlite-dev \
swig \
wget \
xz \
zlib \
zlib-dev
# Build and Install MegaSdkC++
ENV PYTHONWARNINGS=ignore
RUN git clone --depth=1 -b release/v4.8.0 https://github.com/meganz/sdk.git /home/sdk/ && \
cd /home/sdk && rm -rf .git && \
autoupdate -fIv && ./autogen.sh && \
./configure CFLAGS='-fpermissive' CXXFLAGS='-fpermissive' CPPFLAGS='-fpermissive' CCFLAGS='-fpermissive' \
--disable-silent-rules --enable-python --with-sodium --disable-examples --with-python3 --without-freeimage && \
make -j$(nproc --all)
# Stage 2: Install Packages and MegaSdkC++
FROM python:3.11-alpine
LABEL maintaer="Troublescope <[email protected]>"
LABEL description="Docker image for running an application with MegaSdkC++"
LABEL version="1.0"
LABEL release-date="2023-08-20"
# Update and install mandatory packages
RUN apk update && apk upgrade && \
apk add --upgrade --no-cache \
aria2 \
bash \
ca-certificates \
curl \
ffmpeg \
crypto++-dev \
curl-dev \
gcc \
git \
gzip \
jq \
libc-dev \
libmagic \
linux-headers \
lshw \
mediainfo \
openssl-dev \
parallel \
p7zip \
7zip \
py3-setuptools \
py3-wheel \
python3-dev \
pv \
qbittorrent-nox \
rclone \
sqlite-dev \
tzdata \
unzip \
wget \
xz \
zip \
zlib-dev
# Setup working directory
WORKDIR /app/
# Copy MegaSdkC++ from stage 1
COPY --from=build /home/sdk/ /home/sdk/
RUN cd /home/sdk/bindings/python && \
python3 setup.py bdist_wheel && \
cd dist && pip install --no-cache-dir *.whl
# Set locale
RUN echo 'export LC_ALL=en_US.UTF-8' >> /etc/profile.d/locale.sh && \
sed -i 's|LANG=C.UTF-8|LANG=en_US.UTF-8|' /etc/profile.d/locale.sh
# Set timezone to UTC
RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone
# Set shell to Bash
SHELL ["/bin/bash", "-c"]
# Default command
CMD ["bash"]