├── Dockerfile ├── .github ├── dependabot.yml └── workflows │ └── build_and_publish.yml └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | ARG ALPINE_VERSION=edge 2 | FROM alpine:$ALPINE_VERSION 3 | RUN apk --no-cache add dnsmasq-dnssec 4 | EXPOSE 53 53/udp 5 | ENTRYPOINT ["/usr/sbin/dnsmasq", "-k"] 6 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for GitHub Actions 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "daily" 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-dnsmasq 2 | 3 | It's a [dnsmasq][dnsmasq] Docker image. It is only 6 MB in size. It is just an 4 | `ENTRYPOINT` to the `dnsmasq` binary. Can you smell what the rock is cookin'? 5 | 6 | ## Usage 7 | 8 | It is usually a good idea to use a tag other than `latest` if you are using this 9 | image in a production setting. There are several tags to choose from: 10 | 11 | - `4km3/dnsmasq:2.86-r0`: dnsmasq 2.86-r0 based on Alpine 3.15 (for backwards compatibility, `latest` points to this tag) 12 | - `4km3/dnsmasq:2.85-r2`: dnsmasq 2.85-r2 based on Alpine 3.14 13 | - `4km3/dnsmasq:edge`: dnsmasq 2.86-r0 based on Alpine edge 14 | 15 | [dnsmasq][dnsmasq] requires `NET_ADMIN` capabilities to run correctly. Start it 16 | with something like `docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN 4km3/dnsmasq:2.75`. 17 | 18 | The configuration is all handled on the command line (no wrapper scripts here). 19 | The `ENTRYPOINT` is `dnsmasq -k` to keep it running in the foreground. If you 20 | wanted to send requests for an internal domain (such as Consul) you can forward 21 | the requests upstream using something like `docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN 4km3/dnsmasq:2.75 -S /consul/10.17.0.2`. This will send a 22 | request for `redis.service.consul` to `10.17.0.2` 23 | 24 | As this is a very barebones entrypoint with just enough to run in the 25 | foreground, there is no logging enabled by default. To send logging to stdout 26 | you can add `--log-facility=-` as an option. 27 | 28 | [dnsmasq]: http://www.thekelleys.org.uk/dnsmasq/doc.html 29 | -------------------------------------------------------------------------------- /.github/workflows/build_and_publish.yml: -------------------------------------------------------------------------------- 1 | name: Build & Publish 2 | on: 3 | push: 4 | branches: 5 | - "master" 6 | jobs: 7 | test: 8 | runs-on: ubuntu-20.04 9 | strategy: 10 | matrix: 11 | version: 12 | - { 13 | distro: alpine, 14 | rel: 3.14, 15 | dnsmasq: 2.85-r2, 16 | tag: "4km3/dnsmasq:2.85-r2", 17 | } 18 | - { 19 | distro: alpine, 20 | rel: 3.15, 21 | dnsmasq: 2.86-r0, 22 | tag: "4km3/dnsmasq:2.86-r0", 23 | taglatest: "4km3/dnsmasq:latest", 24 | } 25 | - { distro: alpine, rel: edge, dnsmasq: 2.86-r0 } 26 | steps: 27 | - uses: actions/checkout@v3 28 | - name: Check credentials 29 | id: docker-credentials 30 | run: | 31 | echo ::set-output name=defined::$(test -n "${{ secrets.DOCKERHUB_USERNAME }}" && echo true || echo false) 32 | - name: Set up QEMU 33 | uses: docker/setup-qemu-action@v1 34 | - name: Set up Docker Buildx 35 | uses: docker/setup-buildx-action@v1 36 | - name: Login to DockerHub 37 | if: steps.docker-credentials.outputs.defined == 'true' 38 | uses: docker/login-action@v1 39 | with: 40 | username: ${{ secrets.DOCKERHUB_USERNAME }} 41 | password: ${{ secrets.DOCKERHUB_PASSWORD }} 42 | - name: Build and push 43 | if: steps.docker-credentials.outputs.defined == 'true' 44 | id: docker_build 45 | uses: docker/build-push-action@v2 46 | with: 47 | context: . 48 | build-args: ALPINE_VERSION=${{ matrix.version.rel }} 49 | platforms: linux/amd64,linux/arm64,linux/arm/v7 50 | push: true 51 | tags: | 52 | "4km3/dnsmasq:${{ matrix.version.dnsmasq }}-${{ matrix.version.distro }}-${{ matrix.version.rel }}" 53 | ${{ matrix.version.tag }} 54 | ${{ matrix.version.taglatest }} 55 | - name: Image digest 56 | run: echo ${{ steps.docker_build.outputs.digest }} 57 | --------------------------------------------------------------------------------