From f86121e09d92583884a3383e70b481ee03868c80 Mon Sep 17 00:00:00 2001 From: Bilal Amarni Date: Sat, 19 Mar 2016 11:21:22 +0100 Subject: [PATCH] add makefile --- .gitignore | 1 + Makefile | 8 ++++++++ docker-machine-dns.go | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile 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)