Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ARM, upgrade dnsmasq, add Makefile #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version=2.83
platforms=linux/amd64,linux/arm64,linux/arm/v7
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM andyshinn/dnsmasq:2.75
ARG version
FROM andyshinn/dnsmasq:${version}

COPY dnsmasq.conf /etc/dnsmasq.conf
COPY start-with-domain-ip.sh /usr/local/bin
Expand Down
19 changes: 19 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
include .env

default: help

## help : Prints this help.
.PHONY: help
help :
@sed -n 's/^##//p' Makefile

## builder : Create the builder.
.PHONY: builder
builder :
docker buildx create --name dory --use

## build push : Build and push docker images.
.PHONY: build push
build push :
docker buildx build --build-arg version=${version} --platform ${platforms} -t docker.io/tripox/dory-dnsmasq:${version} . --push
docker buildx build --build-arg version=${version} --platform ${platforms} -t docker.io/tripox/dory-dnsmasq:latest . --push
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## What is this?

[Dory](https://github.com/FreedomBen/dory) uses this container to provide the dnsmasq
services in conjunction with an nginx-proxy. It's a very lightweight container built
services in conjunction with an nginx-proxy. It's a very lightweight container built
on Alpine Linux (based off of [andyshinn/dnsmasq](https://hub.docker.com/r/andyshinn/dnsmasq/).
See the [dory](https://github.com/FreedomBen/dory) project page for more info.

Expand Down Expand Up @@ -35,7 +35,7 @@ CMD["docker", "3.3.3.3"]

### Multiple TLDs

You can have more than one TLD if you prefer. Use the container the same way as with a single TLD, but add each domain and ip as extra args.
You can have more than one TLD if you prefer. Use the container the same way as with a single TLD, but add each domain and ip as extra args.

```
docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN freedomben/dory-dnsmasq:1.0.0 [<domain1>] [<ip1>] [<domain2>] [<ip2>]
Expand All @@ -47,18 +47,32 @@ So if you wanted all queries against domain "docker" to be routed to IP 3.3.3.3,
docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN freedomben/dory-dnsmasq:1.0.0 docker 3.3.3.3 dev 4.4.4.4
```

The domains can go to the same IP. You just have to repeat it. Say you wanted both to go to 3.3.3.3:
The domains can go to the same IP. You just have to repeat it. Say you wanted both to go to 3.3.3.3:

```
docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN freedomben/dory-dnsmasq:1.0.0 docker 3.3.3.3 dev 3.3.3.3
```

### Wildcard

You can have all domain names that are not answered from /etc/hosts or DHCP be resolved to a specific address by using a `#` as the domain. So to have all requests be resolved to 4.4.4.4:
You can have all domain names that are not answered from /etc/hosts or DHCP be resolved to a specific address by using a `#` as the domain. So to have all requests be resolved to 4.4.4.4:

```
docker run -p 53:53/tcp -p 53:53/udp --cap-add=NET_ADMIN freedomben/dory-dnsmasq:1.0.0 '#' 4.4.4.4
```

*NOTE: You have to put the # in quotes otherwise bash will think it's a comment character*
_NOTE: You have to put the # in quotes otherwise bash will think it's a comment character_

### Build and push images

Create the builder:

```bash
make builder
```

Build and push images:

```bash
make build push
```