Browse Source

removed privileged mode

tags/v1.0.0
Robin Thoni 6 years ago
parent
commit
c88a85de36
2 changed files with 8 additions and 1 deletions
  1. 2
    1
      docker-compose.yml
  2. 6
    0
      openvpn/run.sh

+ 2
- 1
docker-compose.yml View File

@@ -4,8 +4,9 @@ services:
4 4
     openvpn:
5 5
         build: ./openvpn
6 6
         container_name: vpn-c2s-openvpn
7
-        privileged: true
8 7
 #        restart: unless-stopped
8
+        cap_add:
9
+          - NET_ADMIN
9 10
         networks:
10 11
             vpn-c2s.internal.docker:
11 12
                 aliases:

+ 6
- 0
openvpn/run.sh View File

@@ -4,6 +4,12 @@
4 4
 
5 5
 replace_files
6 6
 
7
+mkdir -p /dev/net
8
+if [ ! -c /dev/net/tun ];
9
+then
10
+  mknod /dev/net/tun c 10 200
11
+fi
12
+
7 13
 if [ ! -e /etc/openvpn/credentials/server.key ]
8 14
 then
9 15
   echo Creating new openvpn credentials...

Loading…
Cancel
Save