diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9471ab3 --- /dev/null +++ b/Makefile @@ -0,0 +1,8 @@ +dev: + tmuxinator start go + +release: + mkdir -p build + GOOS=darwin GOARCH=amd64 go build -o build/docker-machine-dns-darwin-x64 ./docker-machine-dns.go + GOOS=linux GOARCH=amd64 go build -o build/docker-machine-dns-linux-x64 ./docker-machine-dns.go + diff --git a/docker-machine-dns.go b/docker-machine-dns.go index af1759d..870dbe0 100644 --- a/docker-machine-dns.go +++ b/docker-machine-dns.go @@ -39,7 +39,7 @@ func lookup(w dns.ResponseWriter, r *dns.Msg) { } if err != nil { - log.Printf("No IP found for machine '%s'", machine) + log.Printf("No IP found for machine '%s': %s", machine, err) continue } ip := string(stdoutBytes[:len(stdoutBytes)-1]) @@ -85,7 +85,7 @@ func main() { dns.HandleFunc("docker.", lookup) log.Printf("Listening on %s...", addr) - go server.ListenAndServe() + go log.Fatal(server.ListenAndServe()) sig := make(chan os.Signal, 1) signal.Notify(sig, os.Interrupt, os.Kill)