Skip to content

Commit

Permalink
Allow the container to touch DNS (jessfraz#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
meyskens authored and jessfraz committed Dec 16, 2017
1 parent 9d4ecac commit 1dcfad4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openvpn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ FROM alpine:latest
RUN apk --no-cache add \
openvpn

RUN mkdir /usr/share/openvpn
RUN cp /etc/openvpn/* /usr/share/openvpn/

WORKDIR /etc/openvpn
ENTRYPOINT ["openvpn"]
7 changes: 7 additions & 0 deletions openvpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ If you **don't** need to specify a password, you can use `docker-compose run -d
If you OpenVPN configuration needs extra files (certificates etc) you can drop them in this directory too.


## How to fix DNS
To let OpenVPN change your resolv.conf file you need to add 2 scripts to your configuration to trigger the Alpine provided scripts.
```
up /usr/share/openvpn/up.sh
down /usr/share/openvpn/down.sh
```

## Why?

Because we're the containerati and we like when things are [neatly arranged in their boxes](https://twitter.com/zooeypeng/status/613053137050439681).
Expand Down
1 change: 1 addition & 0 deletions openvpn/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ vpn:
build: .
volumes:
- .:/etc/openvpn
- /etc/resolv.conf:/etc/resolv.conf
net: host
devices:
- /dev/net/tun:/dev/net/tun
Expand Down

0 comments on commit 1dcfad4

Please sign in to comment.