Build a lean container image from your Go service in a CI pipeline without installing or running Docker.
Produce multi-architecture container images (e.g., amd64 + arm64) from a single Go build command.
Generate an SBOM automatically alongside your container image for security auditing and compliance requirements.
Deploy a Go app to Kubernetes using ko's YAML templating to stamp the freshly-built image reference directly into manifests.
Requires a working Go toolchain, no Docker needed, but a container registry to push to must be accessible.
ko is a command-line tool for building container images from Go programs. A container image is a packaged, self-contained version of software that can run consistently across different computers or cloud environments. ko is designed specifically for Go code, which means it skips much of the complexity found in general-purpose container build tools. The core idea is that ko runs the Go compiler directly on your machine and turns the result into a container image, without needing Docker installed. This makes it faster to set up and easier to run inside automated build pipelines, where installing Docker can be a hurdle. The tool targets a specific scenario: Go programs that do not rely heavily on operating system libraries or native packages. If your application fits that profile, ko can produce a small, lean image without the overhead of a traditional Dockerfile-based workflow. A few additional capabilities are documented on the project site. ko can build images for multiple processor architectures at once, which matters if your servers and developer laptops use different chips. It also generates an SBOM by default, which is a machine-readable list of all the software components bundled inside the image. This is increasingly required for security auditing in enterprise environments. There is also a YAML templating feature aimed at teams deploying to Kubernetes. The project originated at Google and has applied to join the Cloud Native Computing Foundation as a sandbox project. Discussion happens in the Kubernetes Slack workspace under the ko-build channel. The README for this project is brief and links out to external documentation for installation steps and full feature details.
← ko-build on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.