-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (38 loc) · 1.48 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
# Builder
FROM golang:1.23-alpine AS builder
ARG VERSION=dev
ARG BUILD_DATE
ARG COMMIT_REF
LABEL\
maintainer="Stephen Mwangi <[email protected]>" \
org.opencontainers.image.authors="Stephen Mwangi <[email protected]>" \
org.opencontainers.image.created=$BUILD_DATE \
org.opencontainers.image.description="A DNS resolver with customizable & schedulable filtering for malware, trackers, ads, and other unwanted content" \
org.opencontainers.image.documentation="https://www.beacondns.org" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.revision=$COMMIT_REF \
org.opencontainers.image.source="https://github.com/st3v3nmw/beacon-dns" \
org.opencontainers.image.title="Beacon DNS" \
org.opencontainers.image.url="https://www.beacondns.org" \
org.opencontainers.image.vendor="Beacon DNS" \
org.opencontainers.image.version=$VERSION
ENV CGO_ENABLED=1
WORKDIR /app
RUN apk add --no-cache gcc musl-dev wget unzip
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN wget https://github.com/nalgeon/sqlean/releases/download/0.27.1/sqlean-linux-x86.zip -O /tmp/sqlean.zip \
&& unzip /tmp/sqlean.zip -d ./sqlean
RUN go build \
-ldflags="-w -s -X main.Version=${VERSION}" \
-o beacon ./cmd/beacon
# The beacon-dns image
FROM alpine:latest
RUN apk add --no-cache libc6-compat tzdata
COPY --from=builder /app/beacon /beacon
COPY --from=builder /app/sqlean/stats.so /extensions/stats.so
ENV BEACON_EXTENSIONS_DIR=/extensions
EXPOSE 80
EXPOSE 53
CMD ["/beacon"]