-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathDockerfile
59 lines (54 loc) · 2.22 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
FROM alpine AS builder
RUN mkdir /usr/local/src && apk add binutils --no-cache\
linux-headers \
build-base \
readline-dev \
openssl-dev \
ncurses-dev \
git \
cmake \
zlib-dev \
libsodium-dev \
gnu-libiconv
ENV LD_PRELOAD=/usr/lib/preloadable_libiconv.so
WORKDIR /usr/local/src
RUN git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
#RUN git clone -b ${GIT_TAG} https://github.com/SoftEtherVPN/SoftEtherVPN.git
ENV USE_MUSL=YES
ENV CMAKE_FLAGS="-DSE_PIDDIR=/run/softether -DSE_LOGDIR=/var/log/softether -DSE_DBDIR=/var/lib/softether"
RUN cd SoftEtherVPN &&\
git submodule init &&\
git submodule update &&\
./configure &&\
make -j $(getconf _NPROCESSORS_ONLN) -C build
FROM alpine AS vpnserver
RUN apk add --no-cache readline \
openssl \
libsodium \
gnu-libiconv \
iptables
ENV LD_PRELOAD=/usr/lib/preloadable_libiconv.so
ENV LD_LIBRARY_PATH=/root
WORKDIR /usr/local/bin
VOLUME /var/log/softether
VOLUME /var/lib/softether
VOLUME /run/softether
COPY --from=builder /usr/local/src/SoftEtherVPN/build/vpnserver /usr/local/src/SoftEtherVPN/build/vpncmd /usr/local/src/SoftEtherVPN/build/libcedar.so /usr/local/src/SoftEtherVPN/build/libmayaqua.so /usr/local/src/SoftEtherVPN/build/hamcore.se2 ./
COPY --from=builder /usr/local/src/SoftEtherVPN/build/libcedar.so /usr/local/src/SoftEtherVPN/build/libmayaqua.so ../lib/
EXPOSE 443/tcp 992/tcp 1194/tcp 1194/udp 5555/tcp 500/udp 4500/udp
CMD ["/usr/local/bin/vpnserver", "execsvc"]
FROM alpine AS vpnclient
RUN apk add --no-cache readline \
openssl \
libsodium \
gnu-libiconv \
iptables
ENV LD_PRELOAD=/usr/lib/preloadable_libiconv.so
ENV LD_LIBRARY_PATH=/root
WORKDIR /usr/local/bin
VOLUME /var/log/softether
VOLUME /var/lib/softether
VOLUME /run/softether
COPY --from=builder /usr/local/src/SoftEtherVPN/build/vpnclient /usr/local/src/SoftEtherVPN/build/vpncmd /usr/local/src/SoftEtherVPN/build/libcedar.so /usr/local/src/SoftEtherVPN/build/libmayaqua.so /usr/local/src/SoftEtherVPN/build/hamcore.se2 ./
COPY --from=builder /usr/local/src/SoftEtherVPN/build/libcedar.so /usr/local/src/SoftEtherVPN/build/libmayaqua.so ../lib/
CMD ["/usr/local/bin/vpnclient", "execsvc"]