-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: DNS Cache | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- 'dns-cache/**' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
donation-api: | ||
name: Deploy DNS Cache Image | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- uses: actions/checkout@v3.4.0 | ||
- name: Publish DNS Cache Docker Image | ||
uses: openzim/docker-publish-action@v10 | ||
with: | ||
image-name: kiwix/dns-cache | ||
on-master: latest | ||
restrict-to: kiwix/container-images | ||
context: dns-cache | ||
registries: ghcr.io | ||
credentials: | ||
GHCRIO_USERNAME=${{ secrets.GHCR_USERNAME }} | ||
GHCRIO_TOKEN=${{ secrets.GHCR_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM alpine:3.13 | ||
LABEL org.opencontainers.image.source=https://github.com/kiwix/container-images | ||
|
||
ENV SHELL=bash | ||
|
||
RUN set -e \ | ||
&& apk update \ | ||
&& apk --no-cache add dumb-init bash curl \ | ||
# to setup a DNS cache | ||
&& curl -L -o dnsproxy.tar.gz https://github.com/AdguardTeam/dnsproxy/releases/download/v0.74.1/dnsproxy-linux-amd64-v0.74.1.tar.gz \ | ||
&& tar x -f dnsproxy.tar.gz --strip-components 2 \ | ||
&& mv dnsproxy /usr/bin/ | ||
|
||
EXPOSE 53 | ||
|
||
RUN printf "#!/bin/sh\n\ | ||
echo "---"\n\ | ||
cat /usr/local/bin/entrypoint\n\ | ||
echo "---"\n\ | ||
echo 'nameserver 127.0.0.1' > /etc/resolv.conf\n\ | ||
exec \"\$@\"\n\ | ||
" > /usr/local/bin/entrypoint \ | ||
&& chmod +x /usr/local/bin/entrypoint | ||
|
||
ENTRYPOINT ["/usr/bin/dumb-init", "--", "/usr/local/bin/entrypoint"] | ||
CMD ["dnsproxy", "--cache", "--cache-min-ttl", "3600", "--cache-size", "1024", "--hosts-file-enabled", "--ipv6-disabled", "--listen", "0.0.0.0", "--port", "53", "--upstream", "https://1.1.1.1/dns-query"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# DNS Cache | ||
|
||
A simple DNS Cache that uses a DoH (DNS over HTTP) upstream to workaround DNS-related issues. | ||
|
||
At the moment, it uses [Cloudflare's DoH](https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/) | ||
because it is both reliable and available without bootstraping DNS to resolve its own domain. |