Build gerrit-linter as a docker image

Change-Id: I4f7302d87d38dfb8c2a48865814d9e0b8624f513
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..b654b67
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,38 @@
+FROM golang:1.13 as builder
+
+LABEL maintainer="Han-Wen Nienhuys <hanwen@google.com>"
+
+# Set the Current Working Directory inside the container
+WORKDIR /app
+
+# Copy go mod and sum files
+COPY go.mod go.sum ./
+
+RUN go version
+
+# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
+RUN go mod download
+
+# Copy the source from the current directory to the Working Directory inside the container
+COPY . .
+
+# Build the Go app. The netgo tag ensures we build a static binary.
+RUN go build -tags netgo -o gerrit-linter ./cmd/checker
+RUN go build -tags netgo -o buildifier github.com/bazelbuild/buildtools/buildifier
+RUN curl -L -o google-java-format.jar https://github.com/google/google-java-format/releases/download/google-java-format-1.7/google-java-format-1.7-all-deps.jar
+RUN chmod +x google-java-format.jar
+RUN cp $(which gofmt) .
+
+FROM alpine:latest
+
+RUN apk --no-cache add ca-certificates
+
+WORKDIR /app/
+
+# Copy the Pre-built binary file from the previous stage
+COPY --from=builder /app/gerrit-linter .
+COPY --from=builder /app/gofmt .
+COPY --from=builder /app/buildifier .
+COPY --from=builder /app/google-java-format.jar .
+ENTRYPOINT [ "/app/gerrit-linter" ]
+CMD []
diff --git a/README.md b/README.md
index e9687a7..24065b9 100644
--- a/README.md
+++ b/README.md
@@ -68,6 +68,27 @@
 not be an issue.
 
 
+## DOCKER ON GCP
+
+The following example shows how to build a Docker image hosted on GCP, in the
+project `api-project-164060093628`.
+
+```
+VERSION=$(date --iso-8601=minutes | tr -d ':' | tr '[A-Z]' '[a-z]'| sed \
+    's|\+.*$||')-$(git rev-parse --short HEAD)
+NAME=gcr.io/api-project-164060093628/gerrit-linter:${VERSION}
+docker build -t ${NAME} -f Dockerfile .
+docker push ${NAME}
+```
+
+To deploy onto a GCP VM, configure the VM to have scope
+`https://www.googleapis.com/auth/gerritcodereview`:
+
+```sh
+cloud beta compute instances set-scopes VM-NAME --scopes=https://www.googleapis.com/auth/gerritcodereview
+```
+
+
 ## DISCLAIMER
 
 This is not an official Google product