Skip to content

Commit d777923

Browse files
author
Naiba
committed
add option DNS Server
1 parent 5a0438a commit d777923

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

.env.dist

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
TZ=Europe/Moscow
22
SHELL=/bin/zsh
33
HOSTIP=127.0.0.1
4+
#HOSTIP=docker.for.mac.localhost
5+
DNS1=8.8.8.8
6+
DNS2=8.8.4.4
47

58
SYMFONY_ENV=dev
69
MYSQL_ROOT_PASSWORD=root

conf/dnsmasq/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
FROM alpine:latest
2-
2+
MAINTAINER Naiwa([email protected])
33

44
RUN apk --no-cache add dnsmasq
55
COPY dnsmasq.conf /etc/dnsmasq.conf
66

7+
ARG DNS1
8+
ARG DNS2
9+
RUN echo server=$DNS1>>/etc/dnsmasq.conf \
10+
&& echo server=$DNS2>>/etc/dnsmasq.conf \
11+
&& cat /etc/dnsmasq.conf
12+
713
EXPOSE 53 53/udp
814

915
ENTRYPOINT ["dnsmasq", "-k"]

conf/dnsmasq/dnsmasq.conf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
no-hosts
12
no-resolv
2-
server=8.8.4.4
3-
server=8.8.8.8
4-
address=/.dev/127.0.0.1
3+
strict-order
4+
5+
address=/.dev/127.0.0.1
6+
7+
all-servers

docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,16 @@ services:
9797
- elasticsearch
9898

9999
dnsmasq:
100+
env_file: .env
100101
build:
102+
args:
103+
- DNS1=${DNS1}
104+
- DNS2=${DNS2}
101105
context: ./conf/dnsmasq
102106
ports:
103107
- "53:53"
104108
- "53:53/udp"
105-
cap_add:
109+
cap_add:
106110
- NET_ADMIN
107111
restart: always
108112

0 commit comments

Comments
 (0)