ARG ALPINE_VERSION=latest FROM alpine:${ALPINE_VERSION} AS builder ARG APK_MIRROR=dl-cdn.alpinelinux.org RUN sed -i "s/dl-cdn.alpinelinux.org/${APK_MIRROR}/g" /etc/apk/repositories && \ apk add --no-cache --no-progress curl && \ cd / && \ wget --tries=3 -O smartdns $(curl -s https://api.github.com/repos/pymumu/smartdns/releases/latest | grep browser_download_url | egrep -o 'http.://.+/smartdns-x86_64' | head -n1) FROM alpine:${ALPINE_VERSION} COPY --from=builder /smartdns /usr/local/bin/ RUN chmod +x /usr/local/bin/smartdns COPY smartdns.conf /etc/smartdns/ VOLUME ["/smartdns"] EXPOSE 53/udp 53 ENTRYPOINT ["smartdns", "-f", "-c", "/etc/smartdns/smartdns.conf"]