FerryDocs

Go

What the generated Dockerfile does for a Go project, when you set no build or start command.

Edit on GitHub
golang:1.23-alpinethe build imageBinary/usr/local/bin/appalpine:3.20the run image

The build image downloads the modules with go mod download.

1 / 3

A Go build uses two images. The first image has the Go tools and compiles the app. The second image only runs the .

The defaults

StepWhat Ferry does
Build imagegolang:<version>-alpine. The version comes from the go line of go.mod. The default is 1.23.
Run imagealpine:3.20
Dependenciesgo mod download, in a cached layer of its own.
BuildCGO_ENABLED=0 go build of the root package when it is package main. If not, of the only main package below cmd/<name>.
StartThe binary: /usr/local/bin/app.

On this page