forked from kylemanna/docker-openvpn
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
35 lines (26 loc) · 1.33 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
# Primary credit: https://github.com/jpetazzo/dockvpn
# Secondary credit: https://github.com/kylemanna/docker-openvpn
# Tertiary credit for TAP/bridge adjusments: https://github.com/aktur/docker-openvpn
# Smallest base image
FROM alpine:3.20
LABEL maintainer="Salvoxia <[email protected]>"
# Testing: pamtester
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
apk add --update openvpn=2.6.11-r0 iptables curl bash easy-rsa openvpn-auth-pam google-authenticator pamtester libqrencode && \
ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*
# Needed by scripts
ENV OPENVPN=/etc/openvpn
ENV EASYRSA=/usr/share/easy-rsa \
EASYRSA_CRL_DAYS=3650 \
EASYRSA_PKI=$OPENVPN/pki \
EASYRSA_VARS_FILE=$OPENVPN/vars
VOLUME ["/etc/openvpn"]
# Removed EXPOSE command, since the new configuration will let openVPN server listen on any port, and
# NAT for UDP might be problematic and not work in some environments. Not required at all for bridged setup,
# since the container needs to run in host mode anyway. Use the -p argument for publishing the correct port mapping.
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/