Deploying Go App with GCP, CircleCI, and Spinnaker

Introducing a deployment of the Go app using Google Cloud Platform, CircleCI, and Spinnaker.

Manato Kuroda
11 min readNov 29, 2019


Deploying Go App with GCP, CircleCI, and Spinnaker

This piece will focus on deploying a Go app with Continuous Delivery using Kubernetes, CircleCI, and Spinnaker. After finishing this piece, you can configure these services to automatically build and deploy it. When you modify the code, the changes trigger the pipeline to automatically rebuild and redeploy to production as a new version.


Before reading this piece, you need to:

  • Install Docker
  • Install Go

Example repo

You can view the example code at:

Deployment Overview

The steps of deploying are as follows:

  1. A developer changes the code and pushes it.
  2. CircleCI detects the change, builds a docker image and pushes it to the registry (GCR)
  3. Spinnaker detects the new image automatically, flows through a pipeline and deploys the images to production.

Set up Go app

First off, we prepare a very simple Go app just responding to Hello Go App!

Create a main.go :

Run it:

go run main.go

See it at http://localhost:8080:

Hello, Go App!

Next, we make this app Docker.

Create a DockerFile :

FROM golang:1.13.3-alpineENV GO111MODULE=onWORKDIR /go/src/golang-deploy-gcp
COPY . .
RUN go get -d -v ./...
RUN go install -v ./...