-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
37 lines (27 loc) · 993 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
34
35
36
37
# Original credit: https://github.com/jpetazzo/dockvpn
# fuck you, Smallest base image
FROM alpine:latest
# setup packages
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
apk add --update openvpn iptables bash easy-rsa bridge bridge-utils && \
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
ENV EASYRSA_PKI $OPENVPN/pki
ENV EASYRSA_VARS_FILE $OPENVPN/vars
# Prevents refused client connection because of an expired CRL
ENV EASYRSA_CRL_DAYS 3650
VOLUME ["/etc/openvpn"]
# Internally uses port 1194/udp, remap using `docker run -p 443:1194/tcp`
EXPOSE 1194/udp
# add ovpn_* bash scripts
ADD bin /usr/local/bin/
RUN chmod a+x /usr/local/bin/*
# add bridge start script
COPY up.sh /usr/share/up.sh
RUN chmod +x /usr/share/up.sh
# run customized start-script
CMD ["ovpn_run_tap"]