Init commit.
This commit is contained in:
commit
9bc7660e65
4 changed files with 33 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
config.ovpn
|
||||
auth.txt
|
9
Dockerfile
Normal file
9
Dockerfile
Normal file
|
@ -0,0 +1,9 @@
|
|||
FROM alpine:latest
|
||||
|
||||
RUN apk add bash openvpn openresolv
|
||||
ADD https://raw.githubusercontent.com/alfredopalhares/openvpn-update-resolv-conf/master/update-resolv-conf.sh \
|
||||
/etc/openvpn/update-resolv-conf
|
||||
COPY start-openvpn.sh /usr/local/bin/start-openvpn.sh
|
||||
RUN chmod +x /etc/openvpn/update-resolv-conf
|
||||
RUN chmod +x /usr/local/bin/start-openvpn.sh
|
||||
ENTRYPOINT [ "start-openvpn.sh" ]
|
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
|
@ -0,0 +1,12 @@
|
|||
version: '3.3'
|
||||
services:
|
||||
openvpn:
|
||||
restart: never
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ./config.ovpn:/opt/config.ovpn
|
||||
- ./auth.txt:/opt/auth.txt
|
||||
cap_add:
|
||||
- NET_ADMIN
|
10
start-openvpn.sh
Normal file
10
start-openvpn.sh
Normal file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
create_net_dev() {
|
||||
mkdir -p /dev/net
|
||||
mknod /dev/net/tun c 10 200
|
||||
chmod 600 /dev/net/tun
|
||||
}
|
||||
|
||||
create_net_dev
|
||||
"$@"
|
Loading…
Reference in a new issue