Skip to content

Commit 1e4a9c6

Browse files
committed
Updated
1 parent c1293b1 commit 1e4a9c6

File tree

1 file changed

+28
-14
lines changed

1 file changed

+28
-14
lines changed

README.md

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,45 @@
11
# go-coredns-nomad
22

3-
coredns with nomad plugin for service discovery
3+
coredns with nomad plugin for service discovery. This repository will build a docker container
4+
with coredns and the nomad plugin.
45

5-
Currently in progress, but this is how you build the container.
6+
## Using the container
67

7-
```sh
8-
docker build \
9-
--tag ghcr.io/djthorpe/go-coredns-nomad:v1.11.1 \
10-
--build-arg ARCH=$(arch) \
11-
--build-arg PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]') \
12-
--build-arg VERSION=v1.11.1 \
13-
-f etc/docker/Dockerfile .
14-
```
8+
In order to run this container, and have service discovery
9+
work on port 1053, you need to pass in the following environment variables:
1510

16-
In order to run this container as a non-root user,
11+
* `NOMAD_ADDR` - the address of the nomad server
12+
* `NOMAD_TOKEN` - the token to use to query the nomad server
13+
* `NOMAD_TTL` - the TTL for the DNS records, in seconds
14+
15+
For example:
1716

1817
```sh
19-
docker run --name coredns --rm -p 1053:53 \
18+
docker run --name coredns-nomad --rm -p 1053:53 \
2019
--env NOMAD_ADDR=http://nomad:4646/ \
2120
--env NOMAD_TOKEN=XXXXXX \
2221
--env NOMAD_TTL=10 \
23-
ghcr.io/djthorpe/go-coredns-nomad:v1.11.1
22+
ghcr.io/mutablelogic/coredns-nomad:v1.11.1
2423
```
2524

26-
When you want to test it using dig,
25+
When you want to test it using dig, query `<service>.<namespace>.nomad`. For example,
2726

2827
```sh
2928
dig +tcp -p 1053 @localhost service.default.nomad
3029
```
3130

31+
## Building the container
32+
33+
You can use the pre-built container from the GitHub Container Registry (for arm64 or amd64 on Linux),
34+
or you can build it yourself.
35+
36+
```sh
37+
git clone [email protected]:mutablelogic/go-coredns-nomad.git
38+
cd go-coredns-nomad
39+
docker build \
40+
--tag ${REGISTRY}/${USERNAME}/coredns-nomad:v1.11.1 \
41+
--build-arg ARCH=$(arch) \
42+
--build-arg PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]') \
43+
--build-arg VERSION=v1.11.1 \
44+
-f etc/docker/Dockerfile .
45+
```

0 commit comments

Comments
 (0)