Image size: ~1.85 MiB. Dockerized nextdns. Runs as a non-root user.
5.4K
services:
service.nextdns:
image: defnotgustavom/nextdns
container_name: nextdns
environment:
- NEXTDNS_ID=abcdef # (optional) replace with your own Endpoint ID or remove this line
- NEXTDNS_ARGUMENTS=-listen :5353 -report-client-info -log-queries -cache-size 10MB -max-ttl 5s # custom CLI options
security_opt:
- no-new-privileges
cap_drop:
- ALL
ports:
- 53:5353/udp
restart: always
FROM alpine:edge
ENV PUID=932969
ENV PGID=932969
RUN set -xe && \
apk add git upx g++ go ca-certificates && \
mkdir lol && \
git clone https://github.com/nextdns/nextdns.git /src && \
cd /src && \
CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -gcflags=all=-l -installsuffix cgo -o /go/bin/nextdns && \
upx --ultra-brute \
/go/bin/nextdns
FROM scratch
ENV NEXTDNS_ARGUMENTS="-listen :5353 -report-client-info -log-queries -cache-size 10MB -max-ttl 5s"
ENV NEXTDNS_ID=abcdef
COPY --from=0 /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=0 --chown=932969:932969 --chmod=100 /bin/sh /bin/sh
COPY --from=0 /lib/ld-musl*.so.1 /lib/
COPY --from=0 --chown=932969:932969 --chmod=700 /go/bin/nextdns /bin/nextdns
COPY --from=0 --chown=932969:932969 --chmod=700 /lol /var/run
USER 932969
CMD nextdns run ${NEXTDNS_ARGUMENTS} -config ${NEXTDNS_ID}
Content type
Image
Digest
sha256:bc42a0df7…
Size
2.1 MB
Last updated
11 months ago
docker pull defnotgustavom/nextdns