Skip to content

Commit

Permalink
Make dnsdock great again
Browse files Browse the repository at this point in the history
  • Loading branch information
p1c2u committed Aug 7, 2023
1 parent 1b558dc commit 93fd59a
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 166 deletions.
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

42 changes: 42 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM alpine:3.6 AS builder

ARG GOLANG_VERSION=1.8.4-r0

RUN apk update
RUN apk add go=${GOLANG_VERSION} go-tools=${GOLANG_VERSION} git musl-dev
RUN go version

ENV GOPATH=/go
ENV PATH=${PATH}:/go/bin
ENV CGO_ENABLED=0

RUN go get -v github.com/tools/godep
# RUN go get -u github.com/golang/lint/golint
RUN go get github.com/ahmetb/govvv

RUN mkdir -p /go/src/github.com/p1c2u/dnsdock

WORKDIR /go/src/github.com/p1c2u/dnsdock

RUN git clone https://github.com/p1c2u/dnsdock /go/src/github.com/p1c2u/dnsdock
# RUN git checkout {{$GIT_COMMIT}}

RUN mkdir /tmp/output

WORKDIR /go/src/github.com/p1c2u/dnsdock

ENV GIT_SSL_NO_VERIFY=true

RUN godep restore

ENV GOARCH=arm64

WORKDIR /go/src/github.com/p1c2u/dnsdock/src

RUN govvv build -o /tmp/output/dnsdock

FROM alpine:3.18.2

COPY --from=builder /tmp/output/dnsdock /bin/dnsdock

ENTRYPOINT ["dnsdock"]
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build:
docker build -t dnsdock:latest .

build-test:
docker build -t dnsdock:test . --progress=plain --no-cache
85 changes: 0 additions & 85 deletions Rockerfile

This file was deleted.

19 changes: 9 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# /var/run/docker.sock does not seem to be available for fig
# for this reason we violate LFHS and add the socket directly on /run
dnsdock:
image: conz27/dnsdock
container_name: dnsdock
command: -nameserver 192.168.0.1:53 -nameserver 8.8.8.8:53
volumes:
- /var/run/docker.sock:/run/docker.sock
ports:
- 172.17.0.0:53:53/udp
services:
dnsdock:
image: p1c2u/dnsdock
container_name: dnsdock
command: -nameserver 192.168.0.1:53 -nameserver 8.8.8.8:53
volumes:
- /var/run/docker.sock:/run/docker.sock
ports:
- 172.17.0.0:53:53/udp
20 changes: 10 additions & 10 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://secure.travis-ci.org/aacebedo/dnsdock.png)](http://travis-ci.org/aacebedo/dnsdock)
[![Build Status](https://secure.travis-ci.org/p1c2u/dnsdock.png)](http://travis-ci.org/p1c2u/dnsdock)


## dnsdock
Expand Down Expand Up @@ -48,10 +48,10 @@ Install a golang development environment on your host and type the following com
export GOPATH=/tmp/go
export PATH=${PATH}:${GOPATH}/bin
go get -v github.com/tools/godep
go get -d -v https://github.com/aacebedo/dnsdock
cd ${GOPATH}/src/github.com/aacebedo/dnsdock
go get -d -v https://github.com/p1c2u/dnsdock
cd ${GOPATH}/src/github.com/p1c2u/dnsdock
godep restore
cd ${GOPATH}/src/github.com/aacebedo/dnsdock/src
cd ${GOPATH}/src/github.com/p1c2u/dnsdock/src
go build -o ${GOPATH}/bin/dnsdock
```

Expand All @@ -60,7 +60,7 @@ go build -o ${GOPATH}/bin/dnsdock
To build with docker you need [rocker](https://github.com/grammarly/rocker). Check the
website to install it and type the following commands:
```
git clone https://github.com/aacebedo/dnsdock <clone_directory_path>
git clone https://github.com/p1c2u/dnsdock <clone_directory_path>
rocker build -var ARCH=[amd64|arm] -var OUTPUT_DIR=<outputdir> <clone_directory_path>
```

Expand Down Expand Up @@ -123,7 +123,7 @@ Restart docker daemon after you have done that (`sudo service docker restart`).
Now you only need to run the dnsdock container:

```
docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name dnsdock -p 172.17.0.1:53:53/udp aacebedo/dnsdock [--opts]
docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name dnsdock -p 172.17.0.1:53:53/udp p1c2u/dnsdock [--opts]
```

- `-d` starts container as daemon
Expand Down Expand Up @@ -159,7 +159,7 @@ If you also want to let the host machine discover the containers add `nameserver
Mounting docker daemon's unix socket may not work with default configuration on
these platforms. Please use
[selinux-dockersock](https://github.com/dpw/selinux-dockersock) to fix this.
More information in [#11](https://github.com/aacebedo/dnsdock/issues/11).
More information in [#11](https://github.com/p1c2u/dnsdock/issues/11).

#### TLS Authentication

Expand All @@ -174,7 +174,7 @@ and the `DOCKER_CERTS` to a directory containing files named `ca.pem`,
You may build this into your own container with this example Dockerfile:

```
FROM aacebedo/dnsdock
FROM p1c2u/dnsdock
ENV DOCKER_TLS_VERIFY 1
ENV DOCKER_CERTS /certs
Expand Down Expand Up @@ -314,8 +314,8 @@ Add the following snippet under the `units` part:
[Service]
EnvironmentFile=/etc/environment
ExecStartPre=/bin/sh -c '/usr/bin/docker rm -f dnsdock || ls > /dev/null'
ExecStartPre=/bin/sh -c '/usr/bin/docker pull aacebedo/dnsdock'
ExecStart=/usr/bin/docker run -v /var/run/docker.sock:/var/run/docker.sock --name dnsdock -p ${COREOS_PRIVATE_IPV4}:53:53/udp aacebedo/dnsdock
ExecStartPre=/bin/sh -c '/usr/bin/docker pull p1c2u/dnsdock'
ExecStart=/usr/bin/docker run -v /var/run/docker.sock:/var/run/docker.sock --name dnsdock -p ${COREOS_PRIVATE_IPV4}:53:53/udp p1c2u/dnsdock
ExecStop=/bin/sh -c '/usr/bin/docker stop dnsdock || ls > /dev/null'
```

Expand Down
2 changes: 1 addition & 1 deletion src/core/cmdline.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package core

import (
"fmt"
"github.com/aacebedo/dnsdock/src/utils"
"github.com/p1c2u/dnsdock/src/utils"
"gopkg.in/alecthomas/kingpin.v2"
"strconv"
)
Expand Down
4 changes: 2 additions & 2 deletions src/core/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ package core
import (
"crypto/tls"
"errors"
"github.com/aacebedo/dnsdock/src/servers"
"github.com/aacebedo/dnsdock/src/utils"
"github.com/p1c2u/dnsdock/src/servers"
"github.com/p1c2u/dnsdock/src/utils"
"github.com/docker/engine-api/client"
"github.com/docker/engine-api/types"
eventtypes "github.com/docker/engine-api/types/events"
Expand Down
2 changes: 1 addition & 1 deletion src/core/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package core

import (
"github.com/aacebedo/dnsdock/src/servers"
"github.com/p1c2u/dnsdock/src/servers"
"reflect"
"testing"
)
Expand Down
6 changes: 3 additions & 3 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ package main
import (
"crypto/tls"
"crypto/x509"
"github.com/aacebedo/dnsdock/src/core"
"github.com/aacebedo/dnsdock/src/servers"
"github.com/aacebedo/dnsdock/src/utils"
"github.com/p1c2u/dnsdock/src/core"
"github.com/p1c2u/dnsdock/src/servers"
"github.com/p1c2u/dnsdock/src/utils"
"github.com/op/go-logging"
"io/ioutil"
"os"
Expand Down
2 changes: 1 addition & 1 deletion src/servers/dnsserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package servers
import (
"errors"
"fmt"
"github.com/aacebedo/dnsdock/src/utils"
"github.com/p1c2u/dnsdock/src/utils"
"github.com/miekg/dns"
"net"
"regexp"
Expand Down
2 changes: 1 addition & 1 deletion src/servers/dnsserver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package servers

import (
"github.com/aacebedo/dnsdock/src/utils"
"github.com/p1c2u/dnsdock/src/utils"
"github.com/miekg/dns"
"net"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion src/servers/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ package servers

import (
"encoding/json"
"github.com/aacebedo/dnsdock/src/utils"
"github.com/p1c2u/dnsdock/src/utils"
"github.com/gorilla/mux"
"net/http"
)
Expand Down
2 changes: 1 addition & 1 deletion src/servers/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
package servers

import (
"github.com/aacebedo/dnsdock/src/utils"
"github.com/p1c2u/dnsdock/src/utils"
"io/ioutil"
"net/http"
"strings"
Expand Down

0 comments on commit 93fd59a

Please sign in to comment.