forked from siomiz/SoftEtherVPN
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.aarch64
77 lines (58 loc) · 2.63 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
FROM alpine:3.13 as prep
# from https://github.com/SoftEtherVPN/SoftEtherVPN
RUN apk update \
&& apk add --no-cache --upgrade git \
&& mkdir -p /usr/local/src \
&& cd /usr/local/src \
&& git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git \
&& cd /usr/local/src/SoftEtherVPN \
&& git submodule init \
&& git submodule update
FROM alpine:3.13 as build
COPY --from=prep /usr/local/src /usr/local/src
ENV LANG=en_US.UTF-8
RUN apk update \
&& apk add --no-cache --upgrade build-base ncurses-dev openssl-dev readline-dev zip zlib-dev make cmake libsodium-dev
RUN cd /usr/local/src/SoftEtherVPN \
&& export USE_MUSL=YES \
&& ./configure
RUN make -C build
RUN make -C build install
#Add bin files
RUN touch /usr/local/libexec/softether/vpnserver/vpn_server.config \
&& zip -r9 /artifacts.zip /usr/local/libexec/softether/vpn* /usr/local/bin/vpn* /usr/local/lib64/*
FROM alpine:3.13
MAINTAINER DevDotNet.Org <anton@devdotnet.org>
LABEL maintainer="DevDotNet.Org <anton@devdotnet.org>" \
contributors="See CONTRIBUTORS file <https://github.com/devdotnetorg/docker-softethervpn-alpine/blob/master/CONTRIBUTORS>"
COPY --from=build /artifacts.zip /
COPY copyables /
ENV LANG=en_US.UTF-8
ENV LIFETIMELOGS=0
RUN apk update \
&& apk add --no-cache --upgrade bash iptables openssl-dev musl \
&& chmod +x /entrypoint.sh /gencert.sh /eraselogs.sh \
&& unzip -o /artifacts.zip -d / \
&& rm /artifacts.zip \
&& mv -v /usr/local/lib64/libmayaqua.so /lib/libmayaqua.so \
&& mv -v /usr/local/lib64/libcedar.so /lib/libcedar.so \
&& mkdir -p /usr/vpnserver \
&& mv -v /usr/local/libexec/softether/vpn* /usr \
&& mv -v /usr/local/bin/vpn* /usr/bin \
&& sed -i "s|/usr/local/libexec/softether|/usr|" /usr/bin/vpnserver \
&& sed -i "s|/usr/local/libexec/softether|/usr|" /usr/bin/vpncmd \
&& sed -i "s|/usr/local/libexec/softether|/usr|" /usr/bin/vpnclient \
&& sed -i "s|/usr/local/libexec/softether|/usr|" /usr/bin/vpnbridge \
&& rm -rf /opt \
&& ln -s /usr/vpnserver /opt \
&& mkdir -p /usr/vpnserver/config \
&& cp /usr/vpnserver/vpn_server.config /usr/vpnserver/config/vpn_server.config \
&& rm /usr/vpnserver/vpn_server.config \
&& ln -s /usr/vpnserver/config/vpn_server.config /usr/vpnserver/vpn_server.config \
&& find /usr/bin/vpn* -type f ! -name vpnserver \
-exec sh -c 'ln -s {} /opt/$(basename {})' \;
WORKDIR /usr/local/libexec/softether/vpnserver/
VOLUME ["/usr/vpnserver/config", "/usr/vpnserver/server_log/", "/usr/vpnserver/packet_log/", "/usr/vpnserver/security_log/"]
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 500/udp 4500/udp 1701/tcp 1194/udp 5555/tcp 443/tcp
CMD ["/usr/bin/vpnserver", "execsvc"]