Public | Automated Build

Last pushed: 6 days ago
Short Description
My dnsmasq brings all the boys to the yard, and they're like, it's smaller than yours!
Full Description

docker-dnsmasq

It's a dnsmasq Docker image. It is only 6 MB in size. It is just an ENTRYPOINT to the dnsmasq binary. Can you smell what the rock is cookin'?

Usage

It is usually a good idea to use a tag other than latest if you are using this image in a production setting. There are currently two tags to choose from:

  • andyshinn/dnsmasq:2.72: dnsmasq 2.72 based on Alpine 3.2
  • andyshinn/dnsmasq:2.75: dnsmasq 2.75 based on Alpine 3.3
  • andyshinn/dnsmasq:2.76: dnsmasq 2.76 based on Alpine 3.4

dnsmasq requires NET_ADMIN capabilities to run correctly. Start it with something like docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN andyshinn/dnsmasq:2.75.

The configuration is all handled on the command line (no wrapper scripts here). The ENTRYPOINT is dnsmasq -k to keep it running in the foreground. If you wanted to send requests for an internal domain (such as Consul) you can forward the requests upstream using something like docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN andyshinn/dnsmasq:2.75 -S /consul/10.17.0.2. This will send a request for redis.service.consul to 10.17.0.2

As this is a very barebones entrypoint with just enough to run in the foreground, there is no logging enabled by default. To send logging to stdout you can add --log-facility=- as an option.

Docker Pull Command
Owner
andyshinn
Source Repository

Comments (9)
ket4yii
a month ago

Hello. It's great image, but could you use tags for versioning, because using of latest tag is not good way to manage containers. I mean, there is no way to roll back, for example.

juanitomint
a month ago

Hi! exelent work! here is an example for working in a docker -compose file
dns:
image: andyshinn/dnsmasq:latest
ports:

  - "53:53"
  - "53:53/udp"
cap_add:  
  - NET_ADMIN
demaniak
7 months ago

Hm seems cap-add is still an open issue for Docker 1.12 swarm mode.

Anybody else maybe got a way to run this in Docker swarm mode?

activatedgeek
a year ago

Hey, I have the following marathon configuration:

{
  "id": "dnsmasq",
  "cpus": 0.1,
  "mem": 32.0,
  "instances": 2,
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "andyshinn/dnsmasq:latest",
      "network": "HOST",
      "parameters": [
        { "key": "cap-add", "value": "NET_ADMIN" }
      ]
    }
  },
  "healthChecks": [
    {
      "protocol": "COMMAND",
      "command": {
        "value": "true"
      },
      "gracePeriodSeconds": 120,
      "intervalSeconds": 10,
      "timeoutSeconds": 10,
      "maxConsecutiveFailures": 3
    }
  ],
  "args": ["-S", "/consul/127.0.0.1#8600", "--log-facility=-"],
  "constraints": [["hostname", "UNIQUE"]]
}

Here everything works fine on the host, except that I need to use dig @127.0.0.1 m1.node.consul, instead of dig m1.node.consul. Is this behavior correct?

fontasj
a year ago

I made a Docker hub account just to tell you that these descriptions NAILED IT. thanks for the awesome container too.

arthurkay
2 years ago

You've been forked!

Built a fast, tiny zeroconf adblock DNS off your work here. Cheers!

andyshinn
2 years ago

Updated and linked.

frolvlad
2 years ago

Please, consider adding "Repository Links" to Alpine repo so your image got rebuild when the base image updates. (IMHO it is worth to use official Alpine image in this case.)

justinclayton
2 years ago

ur container rulz. thx