Mbonea commited on
Commit
6b67f24
1 Parent(s): a140f93

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -8
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  # Use the specified Debian image
2
- FROM docker.io/library/debian:latest
 
3
  # Install OpenVPN and Easy-RSA
4
  RUN apt-get update && \
5
  apt-get install -y openvpn easy-rsa iptables && \
@@ -9,13 +10,14 @@ RUN apt-get update && \
9
  COPY openvpn-server.conf /etc/openvpn/server.conf
10
 
11
  # Initialize Easy-RSA PKI
12
- RUN make-cadir /etc/openvpn/vars && \
13
- cd /etc/openvpn/vars && \
14
- . ./vars && \
15
- ./clean-all && \
16
- ./build-ca --batch && \
17
- ./build-key-server --batch server && \
18
- ./build-dh --batch
 
19
 
20
  # Expose port 1194 for OpenVPN
21
  EXPOSE 1194/udp
 
1
  # Use the specified Debian image
2
+ FROM debian:stable-slim
3
+
4
  # Install OpenVPN and Easy-RSA
5
  RUN apt-get update && \
6
  apt-get install -y openvpn easy-rsa iptables && \
 
10
  COPY openvpn-server.conf /etc/openvpn/server.conf
11
 
12
  # Initialize Easy-RSA PKI
13
+ RUN mkdir -p /etc/openvpn/pki && \
14
+ cp -r /usr/share/easy-rsa/* /etc/openvpn/pki && \
15
+ cd /etc/openvpn/pki && \
16
+ ./easyrsa init-pki && \
17
+ ./easyrsa --batch --req-cn=YourServerName build-ca nopass && \
18
+ ./easyrsa --batch gen-dh && \
19
+ ./easyrsa --batch --req-cn=YourServerName build-server-full server nopass && \
20
+ openvpn --genkey secret ta.key
21
 
22
  # Expose port 1194 for OpenVPN
23
  EXPOSE 1194/udp