19 lines
No EOL
731 B
Docker
19 lines
No EOL
731 B
Docker
FROM golang:1.11-alpine as builder
|
|
ENV GOPATH /go
|
|
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
|
|
RUN apk add -U --no-cache git build-base ca-certificates gcc git bash && \
|
|
mkdir -p /go/src/github.com/semihalev /data && \
|
|
cd /go/src/github.com/semihalev/ && \
|
|
git clone https://github.com/semihalev/sdns.git && \
|
|
cd /go/src/github.com/semihalev/sdns/ && \
|
|
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -v -o /go/bin/sdns .
|
|
|
|
|
|
FROM scratch
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
COPY --from=builder /data /data
|
|
COPY --from=builder /go/bin/sdns /app/
|
|
|
|
EXPOSE 53/udp 53 853 8053 8080
|
|
ENTRYPOINT ["/app/sdns"]
|
|
CMD ["-config", "/data/sdns.toml"] |