-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ludns
49 lines (33 loc) · 1.06 KB
/
Dockerfile.ludns
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
FROM --platform=$BUILDPLATFORM golang:1.14-alpine as build-env
# Arguments for build
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
# Install git and certificates
RUN apk update && apk add --no-cache git make
WORKDIR /app
## dependences
COPY go.mod .
COPY go.sum .
RUN go mod download
## build
COPY . .
RUN make binaries SYSTEM="$(scripts/go-compile-args)"
## create docker
FROM alpine
LABEL maintainer="Luis Guillén Civera <luisguillenc@gmail.com>"
# Install git and certificates
RUN apk update && apk add --no-cache bind-tools libcap ca-certificates && update-ca-certificates
# create user for service
RUN adduser -D -g 'luids' ludns
# Import the user and group files from the builder.
COPY --from=build-env /app/bin/ludns /bin/ludns
COPY --from=build-env /app/configs/docker/apiservices.json /etc/luids/
COPY --from=build-env /app/configs/docker/dns/* /etc/luids/dns/
# Set capabilities
RUN setcap CAP_NET_BIND_SERVICE=+eip /bin/ludns
USER ludns
ENV FORWARD_DNS 8.8.8.8:53
EXPOSE 53 53/udp
VOLUME [ "/etc/luids" ]
CMD [ "/bin/ludns", "-conf", "/etc/luids/dns/Corefile" ]