forked from jpillora/docker-dnsmasq
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
54 lines (43 loc) · 1.56 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# dnsmasq in a Docker container
#
# This Dockerfile creates an image for the amd64 architecture.
#
# <https://github.com/outlyer-net/docker-dnsmasq-multiarch>
#
# Note previous versions of this Dockerfile used a more hacky way to
# build multiplatform images, but now that buildx is readily avaible
# things are much simpler
# Stage 0: Preparations. To be run on the build host
FROM alpine:latest AS buildstage
# This script will install the latest version for the current architecture
# Note it requires bash AND the automatic user-agent detection fails
# on Alpine's wget
# It will be saved as /webproc
RUN apk add bash curl \
&& curl https://i.jpillora.com/webproc | bash
# Stage 1: The actual produced image
FROM alpine:latest
LABEL maintainer="Toni Corvera <[email protected]>"
# import webproc binary from previous stage
COPY --from=0 /webproc /usr/local/bin/
# fetch dnsmasq
RUN apk --no-cache add dnsmasq
# configure dnsmasq
# /etc/default/dnsmasq doesn't exist, XXX: stale config from Debian?
#RUN echo -e "ENABLED=1\nIGNORE_RESOLVCONF=yes" > /etc/default/dnsmasq
COPY dnsmasq.conf /etc/dnsmasq.conf
# The dhcp.leases files is put here, may want to mount as tmpfs
# XXX: should this be preserved?
VOLUME [ "/var/lib/misc" ]
# Ports:
# 80: Web interface
# 67: DHCP
# 53: DNS: dns on udp, dns transfers on tcp
EXPOSE 80/tcp 67/udp 53/tcp 53/udp
# run!
ENTRYPOINT ["webproc","--port","80","--configuration-file","/etc/dnsmasq.conf","--","dnsmasq","--no-daemon"]
HEALTHCHECK --interval=30s \
--timeout=30s \
--start-period=10s \
--retries=3 \
CMD [ "pidof", "dnsmasq" ]