-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
53 lines (44 loc) · 1.86 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Credit: https://github.com/jpetazzo/dockvpn
# Credit: https://github.com/kylemanna/docker-openvpn
FROM ubuntu:16.04
MAINTAINER "2stacks@2stacks.net"
# Use docker build --pull --build-arg BUILD_DATE='date' -t 2stacks/docker-ovpn .
ARG BUILD_DATE
# Image details
LABEL net.2stacks.build-date="$BUILD_DATE" \
net.2stacks.name="2stacks" \
net.2stacks.license="MIT" \
net.2stacks.description="Dockerfile for autobuilds" \
net.2stacks.url="http://www.2stacks.net" \
net.2stacks.vcs-type="Git" \
net.2stacks.version="1.2"
# Install OpenVPN
RUN apt-get -y update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
iptables \
software-properties-common && \
curl -fsSL https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - && \
add-apt-repository "deb [arch=amd64] http://build.openvpn.net/debian/openvpn/release/2.4 xenial main" && \
apt-get -y update && apt-get install -y \
easy-rsa \
openvpn \
openvpn-auth-radius \
freeradius-utils \
iputils-ping \
&& rm -rf /var/lib/apt/lists/*
# Add Scripts to Configure and Run OpenVPN
ADD ./bin /usr/local/sbin
RUN chmod 755 /usr/local/sbin/*
# Create Mount Point for OpenVPN Config Files
VOLUME /etc/openvpn
# Expose Container Ports to Host
EXPOSE 443/tcp 1194/udp
# Allow run time config of options
ENV RADIUS_KEY=testing123
ENV RADIUS_HOST=freeradius
ENV DNS_HOST1=1.1.1.1
ENV DNS_HOST2=1.0.0.1
# Execute 'run' Script
CMD run