Skip to main content
Account

ko

Status
stable
Category
App Definition and Development
Subcategory
Application Definition & Image Build
License
Apache-2.0

Rawkode’s personal rating: Watch

ko is a CLI that builds and publishes container images for Go applications without a Dockerfile and without a Docker daemon. You point it at a Go import path and it produces an OCI image and pushes it to a registry in one command.

Because Go binaries are statically linked, ko skips the whole multi-stage Dockerfile dance: it cross-compiles the binary directly with the Go toolchain, then assembles an OCI image in-process using go-containerregistry. The resulting image is based on distroless (gcr.io/distroless/static by default), so you get a tiny, non-root image with no shell or package manager. Because the image has a deterministic, reproducible layer layout, re-publishing the same source produces the same digest, which plays nicely with Sigstore/Cosign signing. ko also has a ko resolve mode that rewrites image: ko://./cmd/foo references in your YAML manifests with the pushed digest, which is the workflow Knative, Tekton, and Kubernetes SIGs use to ship their own components.

For Go projects specifically it replaces Docker+Dockerfile entirely. For multi-language shops the rough equivalents are Buildpacks, Jib (Java), and Bazel rules_oci.

Application Definition & Image Build

Email signup loads here. You can also manage email preferences in account settings.