~linkat/+junk/linkat-vpn-18.04

« back to all changes in this revision

Viewing changes to docker-openvpn/Dockerfile

  • Committer: Francesc Konate
  • Date: 2020-06-04 12:32:16 UTC
  • Revision ID: linkat@xtec.cat-20200604123216-7c13y6qoadtpf3af
Last changes commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Original credit: https://github.com/jpetazzo/dockvpn
 
2
 
 
3
# Smallest base image
 
4
FROM alpine:latest
 
5
 
 
6
LABEL maintainer="Kyle Manna <kyle@kylemanna.com>"
 
7
 
 
8
# Testing: pamtester
 
9
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
 
10
    apk add --update openvpn iptables bash easy-rsa openvpn-auth-pam google-authenticator pamtester && \
 
11
    ln -s /usr/share/easy-rsa/easyrsa /usr/local/bin && \
 
12
    rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*
 
13
 
 
14
# Needed by scripts
 
15
ENV OPENVPN /etc/openvpn
 
16
ENV EASYRSA /usr/share/easy-rsa
 
17
ENV EASYRSA_PKI $OPENVPN/pki
 
18
ENV EASYRSA_VARS_FILE $OPENVPN/vars
 
19
 
 
20
# Prevents refused client connection because of an expired CRL
 
21
ENV EASYRSA_CRL_DAYS 3650
 
22
 
 
23
VOLUME ["/etc/openvpn"]
 
24
 
 
25
# Internally uses port 1194/udp, remap using `docker run -p 443:1194/tcp`
 
26
EXPOSE 1194/udp
 
27
 
 
28
CMD ["ovpn_run"]
 
29
 
 
30
ADD ./bin /usr/local/bin
 
31
RUN chmod a+x /usr/local/bin/*
 
32
 
 
33
# Add support for OTP authentication using a PAM module
 
34
ADD ./otp/openvpn /etc/pam.d/