Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
korc committed Sep 20, 2024
1 parent baa5971 commit 512cb4f
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]

0 comments on commit 512cb4f

Please sign in to comment.