-
Notifications
You must be signed in to change notification settings - Fork 175
/
Dockerfile.ubuntu
70 lines (55 loc) · 1.91 KB
/
Dockerfile.ubuntu
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
FROM alpine:3.16 as prep
LABEL maintainer="Tomohisa Kusano <[email protected]>" \
contributors="See CONTRIBUTORS file <https://github.com/siomiz/SoftEtherVPN/blob/master/CONTRIBUTORS>"
ENV BUILD_VERSION=4.43-9799-beta \
SHA256_SUM=9153a95574f2afd8259ff729e6da3a9898211b69d7d391419270935c8482888c
RUN wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/archive/v${BUILD_VERSION}.tar.gz \
&& echo "${SHA256_SUM} v${BUILD_VERSION}.tar.gz" | sha256sum -c \
&& mkdir -p /usr/local/src \
&& tar -x -C /usr/local/src/ -f v${BUILD_VERSION}.tar.gz \
&& rm v${BUILD_VERSION}.tar.gz
FROM ubuntu:22.04 as build
COPY --from=prep /usr/local/src /usr/local/src
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
libncurses5 \
libncurses5-dev \
libreadline8 \
libreadline-dev \
libssl3 \
libssl-dev \
wget \
zlib1g \
zlib1g-dev \
zip \
&& cd /usr/local/src/SoftEtherVPN_Stable-* \
&& ./configure \
&& make \
&& make install \
&& touch /usr/vpnserver/vpn_server.config \
&& zip -r9 /artifacts.zip /usr/vpn* /usr/bin/vpn*
FROM ubuntu:22.04
COPY --from=build /artifacts.zip /
COPY copyables /
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libncurses5 \
libreadline8 \
libssl3 \
iptables \
unzip \
zlib1g \
&& unzip -o /artifacts.zip -d / \
&& rm -rf /var/lib/apt/lists/* \
&& chmod +x /entrypoint.sh /gencert.sh \
&& rm /artifacts.zip \
&& rm -rf /opt \
&& ln -s /usr/vpnserver /opt \
&& find /usr/bin/vpn* -type f ! -name vpnserver \
-exec bash -c 'ln -s {} /opt/$(basename {})' \;
WORKDIR /usr/vpnserver/
VOLUME ["/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"]