Simple, fast container image builder for Go applications
open sourceApache-2.0self-hostablefree
ko builds container images for Go applications by running go build on your own machine and layering the binary onto a base image, so it needs no Dockerfile and no Docker installed. It suits images that hold a single Go program without cgo or OS package dependencies, makes multi-platform builds easy, produces SBOMs by default, and can resolve Go import paths in Kubernetes YAML into freshly built images (ko resolve, ko apply). It's a Cloud Native Computing Foundation Sandbox project, used by Knative, Tekton, Karpenter, Kyverno and Sigstore.
Ways to install
Package managers
Problems it solves
- build container images for my Go service without writing or maintaining a Dockerfile
- build Go container images in CI where Docker isn't installed or allowed
- produce images for both amd64 and arm64 from one Go build command
- generate an SBOM for every container image we ship without extra tooling
- deploy a Go app to Kubernetes by pointing the YAML at its import path instead of an image tag
- image builds for our Go microservices are slow and huge because of Docker layers we don't need
Features
- builds images with go build, no Docker daemon needed
- no Dockerfile
- multi-platform builds
- SBOMs generated by default
- resolves Go import paths in Kubernetes YAML into built images (ko resolve, ko apply)
- setup-ko GitHub Action
- release binaries with GitHub artifact attestations
Limitations
- Doesn't suit images that need cgo or OS packages: it's for a single Go binary on a base image2
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what ko does.
- Buildah A tool that facilitates building OCI container images
- Jib Build container images for your Java applications
- kaniko Build Container Images In Kubernetes
- Docker Build Cloud Build container images faster on cloud builders with a shared cache, locally and in CI
- BuildKit concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
- Docker Buildx Docker CLI plugin for extended build capabilities with BuildKit
