Need help with golang-docker?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

213 Stars 86 Forks Apache License 2.0 202 Commits 5 Opened issues


Docker images for Go on Google App Engine

Services available


Need anything else?

Contributors list


Build Status

This repository contains sources for the Go App Engine Flex build pipeline. This build pipeline utilizes Google Cloud Build to produce the application image. The

configuration files are used in the build pipeline. User can now specify a Go version in app.yaml via
runtime: go1.x
, where
can be 1.8, 1.9, etc. The resulting application image uses as the base image, which contains a minimal Linux, glibc-based system.

The builder image
is tagged with supported Go major versions for builds to be able to target specific Go version to build against. Run the following gcloud command to list supported versions --
$ gcloud container images list-tags

Use only the Go major version tags e.g. 1.8, 1.9, instead of the unique version-datetime tags.

There are different ways to reuse the

image outside of AppEngine Flex. Here are a couple of examples.

Multi-stage Dockerfile

Read up on how to use Docker's multi-stage builds.

Following is a trivial example of a Dockerfile with multi-stage build using the

image to bring in the Go SDK. The Go SDK is located under /usr/local/go of the builder image.
FROM as builder

WORKDIR /go/src/app COPY main.go .

RUN /usr/local/go/bin/go build -o app .

Application image.


COPY --from=builder /go/src/app/app /usr/local/bin/app

CMD ["/usr/local/bin/app"]

Google Cloud Build

Read up on Google Cloud Build.

You can use one of the

files for configuration file. The builder image's
is the
script, which expects a certain layout of the uploaded directory. In particular, it expects --
  • _gopath/src
    directory containing Go source files within package directory structure.
  • _gopath/main-package-path
    file containing the import path of the main application to be built.
  • top level directory can contain resource files that will be bundled into the application image's

The build script will build the application as referenced in

file and produce an application Dockerfile which the next step will run a docker build on.

You can customize your own cloudbuild.yaml file with your own Dockerfile.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.