Update Dockerfile
Browse files- Dockerfile +10 -8
Dockerfile
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
# Use the specified Debian image
|
| 2 |
-
FROM
|
|
|
|
| 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
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
./
|
| 16 |
-
./build-ca
|
| 17 |
-
./
|
| 18 |
-
./build-
|
|
|
|
| 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
|