Add Dockerfile
This commit is contained in:
parent
54e1c64c63
commit
5abd4b7e5b
1 changed files with 19 additions and 0 deletions
19
Dockerfile
Normal file
19
Dockerfile
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
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"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue