-
Notifications
You must be signed in to change notification settings - Fork 14
/
DockerfileSource
101 lines (85 loc) · 3.21 KB
/
DockerfileSource
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
FROM alpine:3.15 as builder
# This is optimized for GitHub Actions.
# For performance CXXFLAGS="-O2 -pipe" & MAKE_JOBS=$(( $(nproc) + 1 ))
ENV CXXFLAGS "-O2"
ENV MAKE_JOBS 2
WORKDIR /tmp
# Install crypto++ (cryptopp) Compilation is really slow in ARM/v6/v7
# RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing crypto++-dev
# Build crypto++ (cryptopp)
ENV CRYPTOPP_VERSION 8.6.0
RUN apk add --no-cache gcc g++ make wget
RUN wget -O cryptopp.zip https://www.cryptopp.com/cryptopp${CRYPTOPP_VERSION//./}.zip && \
unzip cryptopp.zip -d cryptopp && \
cd cryptopp && \
make CXXFLAGS="$CXXFLAGS -DNDEBUG -fPIC" -f GNUmakefile -j $MAKE_JOBS dynamic libcryptopp.pc && \
make PREFIX="/usr" install-lib && \
ln /usr/lib/libcryptopp.so.8.6.0 /usr/lib/libcryptopp.so.8
# Build aMule
ENV AMULE_VERSION 2.3.3
RUN apk add --no-cache gcc g++ make wget boost-dev geoip-dev libupnp-dev wxgtk3-dev
RUN wget -O amule.tar.xz https://downloads.sourceforge.net/project/amule/aMule/$AMULE_VERSION/aMule-$AMULE_VERSION.tar.xz && \
tar -xf amule.tar.xz && \
cd aMule-* && \
./configure \
CPPFLAGS="$CPPFLAGS -Wno-unused-local-typedefs" \
CFLAGS="$CFLAGS -fPIC" \
CXXFLAGS="$CXXFLAGS -fPIC" \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--mandir=/usr/share/man \
--enable-alcc \
--enable-amule-daemon \
--enable-amulecmd \
--enable-geoip \
--enable-optimize \
--enable-upnp \
--enable-webserver \
--disable-debug \
--disable-nls \
--disable-monolithic \
--with-boost \
--with-wx-config=wx-config-gtk3 && \
make -j $MAKE_JOBS && \
make install
# Reduce binaries size
RUN strip /usr/lib/libcryptopp.so.8 && \
strip /usr/bin/alcc && \
strip /usr/bin/amulecmd && \
strip /usr/bin/amuled && \
strip /usr/bin/amuleweb && \
strip /usr/bin/ed2k
# Install a modern Web UI
RUN cd /usr/share/amule/webserver && \
wget -O AmuleWebUI-Reloaded.zip https://github.com/MatteoRagni/AmuleWebUI-Reloaded/archive/refs/heads/master.zip && \
unzip AmuleWebUI-Reloaded.zip && \
mv AmuleWebUI-Reloaded-master AmuleWebUI-Reloaded && \
rm -rf AmuleWebUI-Reloaded.zip AmuleWebUI-Reloaded/doc-images
FROM alpine:3.15
LABEL maintainer="ngosang@hotmail.es"
# Install packages
RUN apk add --no-cache libgcc libpng libstdc++ libupnp musl zlib wxgtk-base tzdata pwgen sudo
# Copy binaries
COPY --from=builder /usr/lib/libcryptopp.so.8 /usr/lib/
COPY --from=builder /usr/bin/alcc /usr/bin/amulecmd /usr/bin/amuled /usr/bin/amuleweb /usr/bin/ed2k /usr/bin/
COPY --from=builder /usr/share/amule /usr/share/amule
# Check binaries are OK
RUN ldd /usr/bin/alcc && \
ldd /usr/bin/amulecmd && \
ldd /usr/bin/amuled && \
ldd /usr/bin/amuleweb && \
ldd /usr/bin/ed2k
# Add entrypoint
COPY entrypoint.sh /home/amule/entrypoint.sh
WORKDIR /home/amule
EXPOSE 4711/tcp 4712/tcp 4662/tcp 4665/udp 4672/udp
ENTRYPOINT ["/home/amule/entrypoint.sh"]
# HELP
#
# => Build Docker image
# docker build -t ngosang/amule:test .
#
# => Reference Alpine packages
# https://git.alpinelinux.org/aports/tree/testing/crypto++
# https://git.alpinelinux.org/aports/tree/testing/amule