Refactor gpu-installer cloud build config to plug in with top level repo cloudbuild

Top level cloud build will receive substitutions from the automated gerrit trigger.

Tested by manually executing top level cloud build:
```
tools$ gcloud builds submit --config=cloudbuild.yaml
--substitutions=_OUTPUT_PROJECT="rnv-dev-301509",COMMIT_SHA=$(git
rev-parse HEAD)
```

https://cloud.google.com/build/docs/configuring-builds/substitute-variable-values
: $COMMIT_SHA is provided as default substitutions for all builds

BUG=b/183723138

Change-Id: Ic2d44a1d1e0eebecdbd7f93c60407d9e8a765118
Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/16290
Cloud-Build: GCB Service account <228075978874@cloudbuild.gserviceaccount.com>
Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com>
Tested-by: Robert Kolchmeyer <rkolchmeyer@google.com>
diff --git a/cloudbuild.yaml b/cloudbuild.yaml
index bd839e9..ffbf59b 100644
--- a/cloudbuild.yaml
+++ b/cloudbuild.yaml
@@ -12,7 +12,7 @@
 
       echo "Building $d ... "
       (
-        gcloud builds submit $d --config=${config}
+        gcloud builds submit --config=${config} --substitutions=_OUTPUT_PROJECT=${_OUTPUT_PROJECT},TAG_NAME=${COMMIT_SHA}
       ) &
     done
     wait
diff --git a/src/cmd/cos_gpu_installer/Dockerfile b/src/cmd/cos_gpu_installer/Dockerfile
new file mode 100644
index 0000000..16d1156
--- /dev/null
+++ b/src/cmd/cos_gpu_installer/Dockerfile
@@ -0,0 +1,23 @@
+FROM golang:1.16 as cos-gpu-installer-go-builder
+COPY . /work/
+WORKDIR /work/src/cmd/cos_gpu_installer
+ARG TARGETOS
+ARG TARGETARCH
+RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o cos-gpu-installer main.go
+
+# Dockerfile for the COS GPU Installer container.
+FROM debian:9
+LABEL maintainer="cos-containers@google.com"
+
+COPY --from=cos-gpu-installer-go-builder /work/src/cmd/cos_gpu_installer/cos-gpu-installer /cos-gpu-installer
+
+# Install minimal tools needed to build kernel modules.
+RUN apt-get update -qq && \
+    apt-get install -y xz-utils kmod git make bc curl ccache \
+    libc6-dev pciutils gcc libelf-dev libssl-dev bison flex keyutils python2.7-minimal && \
+    rm -rf /var/lib/apt/lists/* && \
+    # x86_64-cros-linux-gnu-clang depends on /usr/bin/python2
+    ln -s /usr/bin/python2.7 /usr/bin/python2
+
+ENTRYPOINT ["/cos-gpu-installer"]
+CMD ["install"]
diff --git a/src/cmd/cos_gpu_installer/cloudbuild.yaml b/src/cmd/cos_gpu_installer/cloudbuild.yaml
new file mode 100644
index 0000000..1ea0099
--- /dev/null
+++ b/src/cmd/cos_gpu_installer/cloudbuild.yaml
@@ -0,0 +1,24 @@
+options:
+  env:
+  - 'DOCKER_CLI_EXPERIMENTAL=enabled'
+steps:
+# This step is needed to add a new entry to /proc/sys/fs/binfmt_misc. Docker
+# uses QEMU user emulation to run arm64 programs on x86 hosts. A QEMU
+# interpreter needs to be added to /proc/sys/fs/binfmt_misc to run arm64
+# programs.
+- name: 'gcr.io/cloud-builders/docker'
+  args: ['run', '--privileged', 'linuxkit/binfmt:v0.7']
+# The default builder (which appears to be the Docker daemon that implements
+# the old, familiar `docker build` behavior) doesn't support the --platform
+# flag, so we need to create a new builder.
+- name: 'gcr.io/cloud-builders/docker'
+  args: ['buildx', 'create', '--name', 'builder']
+- name: 'gcr.io/cloud-builders/docker'
+  args: ['buildx', 'use', 'builder']
+# Images produced in this way do not appear in the Docker image registry shown
+# by `docker images`, at least by default. We use the --push flag to push the
+# image after building it, because a subsequent `docker push` won't find the
+# image locally.
+- name: 'gcr.io/cloud-builders/docker'
+  args: ['buildx', 'build', '--platform', 'linux/amd64', '-f', 'src/cmd/cos_gpu_installer/Dockerfile', '-t', 'gcr.io/${_OUTPUT_PROJECT}/cos-gpu-installer:${TAG_NAME}', '--push', '.']
+timeout: 1800s