container-openvpn/Dockerfile

34 lines
1.0 KiB
Docker
Raw Normal View History

# Original credit: https://github.com/jpetazzo/dockvpn
2016-02-06 18:40:54 +00:00
# Leaner build then Ubunutu
FROM debian:jessie
MAINTAINER Kyle Manna <kyle@kylemanna.com>
2016-02-06 18:40:54 +00:00
RUN apt-get update && \
2016-02-06 18:45:42 +00:00
apt-get install -y openvpn iptables curl libpam-google-authenticator && \
2016-02-06 18:40:54 +00:00
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN mkdir -p /usr/local/share/easy-rsa && \
curl -L https://github.com/OpenVPN/easy-rsa/archive/v3.0.0.tar.gz | tar xzf - --strip=1 -C /usr/local/share/easy-rsa easy-rsa-3.0.0/easyrsa3 && \
ln -s /usr/local/share/easy-rsa/easyrsa3/easyrsa /usr/local/bin
# Needed by scripts
ENV OPENVPN /etc/openvpn
2016-02-06 18:40:54 +00:00
ENV EASYRSA /usr/local/share/easy-rsa/easyrsa3
ENV EASYRSA_PKI $OPENVPN/pki
ENV EASYRSA_VARS_FILE $OPENVPN/vars
VOLUME ["/etc/openvpn"]
# Internally uses port 1194/udp, remap using `docker run -p 443:1194/tcp`
EXPOSE 1194/udp
WORKDIR /etc/openvpn
CMD ["ovpn_run"]
ADD ./bin /usr/local/bin
RUN chmod a+x /usr/local/bin/*
2016-02-06 19:23:59 +00:00
# Add support for OTP authentication using a PAM module
ADD ./otp/openvpn /etc/pam.d