forked from siomiz/SoftEtherVPN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (39 loc) · 1.65 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
FROM alpine:3.7 as prep
LABEL maintainer="Tomohisa Kusano <[email protected]>" \
contributors="See CONTRIBUTORS file <https://github.com/siomiz/SoftEtherVPN/blob/master/CONTRIBUTORS>"
ENV BUILD_VERSION=4.28-9669-beta \
SHA256_SUM=fbf6e04c4451d0cb1555c3a53c178b5453c7d761119f82fd693538c9f115fecb
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 centos:7 as build
COPY --from=prep /usr/local/src /usr/local/src
RUN yum -y update \
&& yum -y groupinstall "Development Tools" \
&& yum -y install ncurses-devel openssl-devel readline-devel \
&& 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 centos:7
COPY --from=build /artifacts.zip /
COPY copyables /
RUN yum -y update \
&& yum -y install unzip iptables sysvinit-tools \
&& rm -rf /var/log/* /var/cache/yum/* /var/lib/yum/* \
&& chmod +x /entrypoint.sh /gencert.sh \
&& unzip -o /artifacts.zip -d / \
&& rm /artifacts.zip \
&& rm -rf /opt \
&& ln -s /usr/vpnserver /opt \
&& find /usr/bin/vpn* -type f ! -name vpnserver \
-exec sh -c 'ln -s {} /opt/$(basename {})' \;
WORKDIR /usr/vpnserver/
VOLUME ["/usr/vpnserver/server_log/"]
ENTRYPOINT ["/entrypoint.sh"]
EXPOSE 500/udp 4500/udp 1701/tcp 1194/udp 5555/tcp 443/tcp
CMD ["/usr/bin/vpnserver", "execsvc"]