diff --git a/watchdog/Dockerfile b/watchdog/Dockerfile
index e6facbbe64226b8f8642af94755e3084df701363..d475f7f6ecfb02a8ca18f9a8510e2564c08317d1 100644
--- a/watchdog/Dockerfile
+++ b/watchdog/Dockerfile
@@ -10,6 +10,9 @@ COPY requesthandler_test.go .
 #COPY requestHandler.go   .
 COPY types types
 
+# Run a gofmt and exclude all vendored code.
+RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*")
+
 RUN go test
 
 # Stripping via -ldflags "-s -w" 
diff --git a/watchdog/build.sh b/watchdog/build.sh
index 55b8e8231fa7be858ebc2fb088b2880a5d31a64f..d41d839fff92928a5077e339cfc63d0304829355 100755
--- a/watchdog/build.sh
+++ b/watchdog/build.sh
@@ -11,9 +11,10 @@ else
 fi
 
 docker create --name buildoutput functions/watchdog:build echo
-docker cp buildoutput:/go/src/github.com/alexellis/faas/watchdog/watchdog ./fwatchdog
 
+docker cp buildoutput:/go/src/github.com/alexellis/faas/watchdog/watchdog ./fwatchdog
 docker cp buildoutput:/go/src/github.com/alexellis/faas/watchdog/watchdog-armhf ./fwatchdog-armhf
 docker cp buildoutput:/go/src/github.com/alexellis/faas/watchdog/watchdog.exe ./fwatchdog.exe
 
 docker rm buildoutput
+