+# build and test
+COPY . /go/src/ws
+
+# Generate Swagger code
+RUN /go/bin/swagger generate server -f api/appmgr_rest_api.yaml --name AppManager -t pkg/ --exclude-main
+
+COPY . /go/src/ws
+
+# Build the code
+RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/src/ws/cache/go/cmd/appmgr cmd/appmgr.go
+
+# Run unit tests
+RUN GO111MODULE=on GO_ENABLED=0 GOOS=linux go test -p 1 -cover ./pkg/resthooks/
+
+RUN gofmt -l $(find cmd/ pkg/ -name '*.go' -not -name '*_test.go')