-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
89 lines (74 loc) · 2.25 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
FROM alpine:3 AS builder
LABEL author="DIVA.EXCHANGE Association <[email protected]>" \
maintainer="DIVA.EXCHANGE Association <[email protected]>" \
name="diva-i2p" \
description="Distributed digital value exchange upholding security, reliability and privacy" \
url="https://diva.exchange"
RUN apk --no-cache --virtual build-dependendencies add \
cmake \
make \
gcc \
g++ \
binutils \
libtool \
libev-dev \
check-dev \
zlib-dev \
boost-dev \
build-base \
openssl-dev \
openssl \
git \
sed \
autoconf \
automake \
miniupnpc \
miniupnpc-dev
COPY conf/ /i2pd/conf/
COPY network/ /i2pd/network/
COPY certificates/ /i2pd/data/certificates/
# install deps && build i2p binary
RUN mkdir -p /i2pd/data/addressbook \
&& mkdir /i2pd/tunnels.null \
&& mkdir /i2pd/tunnels.source.conf.d \
&& mkdir /i2pd/tunnels.conf.d \
&& mkdir /i2pd/bin
RUN cd /tmp \
&& git clone --depth 1 --branch 2.54.0 https://github.com/PurpleI2P/i2pd.git
#patch to remove boost-filesystem dependency
RUN sed -i 's/find_package(Boost REQUIRED COMPONENTS system filesystem program_options)/find_package(Boost REQUIRED COMPONENTS system program_options)/g' /tmp/i2pd/build/CMakeLists.txt
RUN cd /tmp/i2pd/build \
&& cmake -DWITH_AESNI=ON -DWITH_UPNP=ON . \
&& make -j $(nproc) \
&& strip i2pd
FROM alpine:3
RUN apk --no-cache add \
boost-system \
boost-program_options \
openssl \
musl-utils \
libstdc++ \
sed \
miniupnpc
RUN mkdir -p /i2pd/data/addressbook \
&& mkdir /i2pd/tunnels.null \
&& mkdir /i2pd/tunnels.source.conf.d \
&& mkdir /i2pd/tunnels.conf.d \
&& mkdir /i2pd/bin
COPY --from=builder /tmp/i2pd/build/i2pd /i2pd/bin/i2pd
COPY --from=builder /tmp/i2pd/LICENSE /i2pd/LICENSE
COPY --from=builder /tmp/i2pd/ChangeLog /i2pd/ChangeLog
COPY conf/ /i2pd/conf/
COPY network/ /i2pd/network/
COPY certificates/ /i2pd/data/certificates/
COPY htdocs/ /i2pd/htdocs/
COPY entrypoint.sh /
RUN cp /i2pd/conf/addresses-initial.org.csv /i2pd/data/addressbook/addresses.csv \
&& addgroup -g 1000 i2pd \
&& adduser -u 1000 -G i2pd -s /bin/sh -h "/home/i2pd" -D i2pd \
&& chown -R i2pd:i2pd /i2pd \
&& chmod 0700 /i2pd/bin/i2pd \
&& chmod +x /entrypoint.sh \
&& mkdir -p /home/i2pd/
WORKDIR "/home/i2pd/"
ENTRYPOINT ["/entrypoint.sh"]