-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
33 lines (24 loc) · 948 Bytes
/
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
# Original credit: https://github.com/jpetazzo/dockvpn
# Smallest base image
FROM alpine:edge
LABEL maintainer="Tomas Nevar <[email protected]>"
# Testing: pamtester
RUN apk add --update openvpn iptables iptables-legacy bash easy-rsa openvpn-auth-pam google-authenticator libqrencode && \
apk update && apk upgrade && \
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/* && \
rm /sbin/iptables && \
ln -s /sbin/iptables-legacy /sbin/iptables
# Needed by scripts
ENV OPENVPN=/etc/openvpn
ENV EASYRSA=/usr/share/easy-rsa \
EASYRSA_CRL_DAYS=3650 \
EASYRSA_PKI=$OPENVPN/pki
VOLUME ["/etc/openvpn"]
# Internally uses port 1194/udp, remap using `docker run -p 443:1194/tcp`
EXPOSE 1194/udp
CMD ["ovpn_run"]
ADD ./bin /usr/local/bin
RUN chmod a+x /usr/local/bin/*
# Add support for OTP authentication using a PAM module
ADD ./otp/openvpn /etc/pam.d/