Skip to content

Commit

Permalink
change docker api
Browse files Browse the repository at this point in the history
  • Loading branch information
Petar Petrov committed Jan 22, 2024
1 parent e0bdc52 commit 05d4897
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 37 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ 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/dz3n/dnsdock
RUN mkdir -p /go/src/github.com/aacebedo/dnsdock

WORKDIR /go/src/github.com/dz3n/dnsdock
WORKDIR /go/src/github.com/aacebedo/dnsdock

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

RUN mkdir /tmp/output

WORKDIR /go/src/github.com/dz3n/dnsdock
WORKDIR /go/src/github.com/aacebedo/dnsdock

ENV GIT_SSL_NO_VERIFY=true

RUN godep restore

ENV GOARCH=amd64

WORKDIR /go/src/github.com/dz3n/dnsdock/src
WORKDIR /go/src/github.com/aacebedo/dnsdock/src

RUN govvv build -o /tmp/output/dnsdock

Expand All @@ -41,4 +41,4 @@ ENV GOARCH=amd64

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

ENTRYPOINT ["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.

19 changes: 10 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
services:
dnsdock:
image: dz3n/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
# /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
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/dz3n/dnsdock.png)](http://travis-ci.org/dz3n/dnsdock)
[![Build Status](https://secure.travis-ci.org/aacebedo/dnsdock.png)](http://travis-ci.org/aacebedo/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/dz3n/dnsdock
cd ${GOPATH}/src/github.com/dz3n/dnsdock
go get -d -v https://github.com/aacebedo/dnsdock
cd ${GOPATH}/src/github.com/aacebedo/dnsdock
godep restore
cd ${GOPATH}/src/github.com/dz3n/dnsdock/src
cd ${GOPATH}/src/github.com/aacebedo/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/dz3n/dnsdock <clone_directory_path>
git clone https://github.com/aacebedo/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 dz3n/dnsdock [--opts]
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]
```

- `-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/dz3n/dnsdock/issues/11).
More information in [#11](https://github.com/aacebedo/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 dz3n/dnsdock
FROM aacebedo/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 dz3n/dnsdock'
ExecStart=/usr/bin/docker run -v /var/run/docker.sock:/var/run/docker.sock --name dnsdock -p ${COREOS_PRIVATE_IPV4}:53:53/udp dz3n/dnsdock
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
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/dz3n/dnsdock/src/utils"
"github.com/aacebedo/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/dz3n/dnsdock/src/servers"
"github.com/dz3n/dnsdock/src/utils"
"github.com/aacebedo/dnsdock/src/servers"
"github.com/aacebedo/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/dz3n/dnsdock/src/servers"
"github.com/aacebedo/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/dz3n/dnsdock/src/core"
"github.com/dz3n/dnsdock/src/servers"
"github.com/dz3n/dnsdock/src/utils"
"github.com/aacebedo/dnsdock/src/core"
"github.com/aacebedo/dnsdock/src/servers"
"github.com/aacebedo/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/dz3n/dnsdock/src/utils"
"github.com/aacebedo/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/dz3n/dnsdock/src/utils"
"github.com/aacebedo/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/dz3n/dnsdock/src/utils"
"github.com/aacebedo/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/dz3n/dnsdock/src/utils"
"github.com/aacebedo/dnsdock/src/utils"
"io/ioutil"
"net/http"
"strings"
Expand Down

0 comments on commit 05d4897

Please sign in to comment.