forked from wheelybird/openvpn-server-ldap-otp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (34 loc) · 1.23 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
FROM ubuntu:22.04
MAINTAINER Brian Lycett <[email protected]>
RUN apt-get update && apt-get install -y --no-install-recommends wget ca-certificates gnupg && \
wget https://swupdate.openvpn.net/repos/repo-public.gpg && \
apt-key add repo-public.gpg && \
echo 'deb https://build.openvpn.net/debian/openvpn/stable jammy main' > /etc/apt/sources.list.d/openvpn.list && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
easy-rsa \
fail2ban \
ipcalc \
iptables \
libpam-google-authenticator \
libpam-ldapd \
net-tools \
nslcd \
openssl \
openvpn && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/* && \
mkdir /opt/easyrsa && \
cp -rp /usr/share/easy-rsa/x509-types /opt/easyrsa/ && \
cp -rp /usr/share/easy-rsa/easyrsa /opt/easyrsa/
EXPOSE 1194/udp
EXPOSE 5555/tcp
ADD ./files/bin /usr/local/bin
RUN chmod a+x /usr/local/bin/*
ADD ./files/configuration /opt/configuration
ADD ./files/etc/pam.d/openvpn* /opt/
ADD ./files/easyrsa/* /opt/easyrsa/
# Use a volume for data persistence
VOLUME /etc/openvpn
CMD ["/usr/local/bin/entrypoint"]