forked from appbooster/docker-ikev2-vpn-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (30 loc) · 1.54 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
FROM alpine
ENV VPNHOST="161.35.218.22"
ENV LEEMAIL="devkinitaleino@gmail.com"
ENV TZ="Europe/Moscow"
# strongSwan Version
ARG SS_VERSION="https://download.strongswan.org/strongswan-5.9.2.tar.bz2"
ARG BUILD_DEPS="gettext"
ARG RUNTIME_DEPS="libintl"
# Install dep packge , Configure,make and install strongSwan
RUN apk --update add build-base curl bash iproute2 iptables-dev openssl openssl-dev supervisor bash certbot \
&& mkdir -p /tmp/strongswan \
&& apk add --update $RUNTIME_DEPS \
&& apk add --virtual build_deps $BUILD_DEPS \
&& cp /usr/bin/envsubst /usr/local/bin/envsubst \
&& curl -Lo /tmp/strongswan.tar.gz $SS_VERSION \
&& tar --strip-components=1 -C /tmp/strongswan -xf /tmp/strongswan.tar.gz \
&& cd /tmp/strongswan \
&& ./configure --enable-eap-identity --enable-eap-md5 --enable-eap-mschapv2 --enable-eap-tls --enable-eap-ttls --enable-eap-peap --enable-eap-tnc --enable-eap-dynamic --enable-xauth-eap --enable-dhcp --enable-openssl --enable-addrblock --enable-unity --enable-certexpire --enable-radattr --enable-swanctl --enable-eap-radius --disable-gmp && make && make install \
&& rm -rf /tmp/* \
&& apk del build-base openssl-dev build_deps \
&& rm -rf /var/cache/apk/* \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone \
&& rm /usr/local/etc/ipsec.secrets
COPY ./run.sh /run.sh
COPY ./adduser.sh /adduser.sh
COPY ./rmuser.sh /rmuser.sh
RUN chmod 755 /run.sh /adduser.sh /rmuser.sh
VOLUME ["/usr/local/etc/ipsec.secrets"]
EXPOSE 500:500/udp 4500:4500/udp
CMD ["/run.sh"]