24 lines
559 B
Docker
24 lines
559 B
Docker
FROM golang:1.22.1-alpine AS build
|
|
|
|
WORKDIR /src
|
|
COPY src /src
|
|
RUN \
|
|
go mod download && \
|
|
CGO_ENABLED=0 GOOS=linux go build -a -o /dnsproxy cmd/main.go
|
|
|
|
|
|
FROM alpine:latest
|
|
|
|
RUN \
|
|
apk --update upgrade && \
|
|
apk add unbound bind-tools tini && \
|
|
wget -O /etc/unbound/named.cache ftp://ftp.internic.net//domain/named.cache
|
|
|
|
COPY rootfs /
|
|
COPY --from=build /dnsproxy /app/
|
|
|
|
HEALTHCHECK --interval=30s --start-period=5s --timeout=10s \
|
|
CMD /usr/bin/host -T -p 1053 asperti.com 127.0.0.1
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--", "/bin/sh", "/app/entrypoint.sh"]
|