mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2024-11-27 04:16:45 +01:00
Allow the container to touch DNS (#300)
This commit is contained in:
parent
9d4ecac24b
commit
1dcfad42ae
|
@ -2,5 +2,8 @@ FROM alpine:latest
|
||||||
RUN apk --no-cache add \
|
RUN apk --no-cache add \
|
||||||
openvpn
|
openvpn
|
||||||
|
|
||||||
|
RUN mkdir /usr/share/openvpn
|
||||||
|
RUN cp /etc/openvpn/* /usr/share/openvpn/
|
||||||
|
|
||||||
WORKDIR /etc/openvpn
|
WORKDIR /etc/openvpn
|
||||||
ENTRYPOINT ["openvpn"]
|
ENTRYPOINT ["openvpn"]
|
||||||
|
|
|
@ -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.
|
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?
|
## Why?
|
||||||
|
|
||||||
Because we're the containerati and we like when things are [neatly arranged in their boxes](https://twitter.com/zooeypeng/status/613053137050439681).
|
Because we're the containerati and we like when things are [neatly arranged in their boxes](https://twitter.com/zooeypeng/status/613053137050439681).
|
||||||
|
|
|
@ -2,6 +2,7 @@ vpn:
|
||||||
build: .
|
build: .
|
||||||
volumes:
|
volumes:
|
||||||
- .:/etc/openvpn
|
- .:/etc/openvpn
|
||||||
|
- /etc/resolv.conf:/etc/resolv.conf
|
||||||
net: host
|
net: host
|
||||||
devices:
|
devices:
|
||||||
- /dev/net/tun:/dev/net/tun
|
- /dev/net/tun:/dev/net/tun
|
||||||
|
|
Loading…
Reference in New Issue
Block a user