diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..944a186 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM golang AS builder + +WORKDIR /go/src/PR-DNSd + +COPY go.mod go.sum ./ + +RUN go mod download && go mod verify + +COPY *.go ./ + +RUN CGO_ENABLED=0 GOOS=linux \ + go build -a -installsuffix cgo -o /go/bin/ \ + -ldflags "-X main.DefaultChroot=" \ + ./... + +FROM scratch + +COPY --from=builder /go/bin/* /bin/ +COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/ca-bundle.pem + +EXPOSE 53/udp + +ENTRYPOINT [ "/bin/PR-DNSd" ]