forked from dmachard/go-dnscollector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
27 lines (17 loc) · 764 Bytes
/
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
FROM golang:1.23.2-alpine3.19 as builder
ARG VERSION
WORKDIR /build
COPY . .
RUN apk add git \
&& CGO_ENABLED=0 go build -ldflags="-s -w -X 'github.com/prometheus/common/version.Version=$VERSION'"
FROM alpine:3.20.3
RUN apk add --no-cache tzdata \
&& mkdir -p /etc/dnscollector/ /var/dnscollector/ \
&& addgroup -g 1000 dnscollector && adduser -D -H -G dnscollector -u 1000 -S dnscollector \
&& chown dnscollector:dnscollector /var/dnscollector /etc/dnscollector
USER dnscollector
COPY --from=builder /build/go-dnscollector /bin/go-dnscollector
COPY --from=builder /build/docker-config.yml ./etc/dnscollector/config.yml
EXPOSE 6000/tcp 8080/tcp 9165/tcp
ENTRYPOINT ["/bin/go-dnscollector"]
CMD ["-config", "/etc/dnscollector/config.yml"]