ko
$ ko Official Med Riskko compiles Go packages directly into distroless OCI images without a Docker daemon or Dockerfile, replacing ko:// import paths in Kubernetes YAML manifests via ko resolve and ko apply. It supports --local, --push=false, and automatic SPDX SBOM synthesis.
brew install ko ko compiles local Go binaries directly into OCI tarballs or registries using the host Go toolchain; MCP is unnecessary.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Clean non-interactive Go CLI with --push=false and --local dry/local flags and ko resolve stdout YAML, though ko build prints an image ref string rather than JSON.
--push=falseand--localprevent unintended remote pushesko resolverenders manifests to stdout without cluster writes
Automatically generates SPDX SBOMs and avoids Dockerfiles/root daemons, though ko build defaults to pushing unless --local or --push=false is passed.
- Built-in SPDX SBOM generation enabled by default
- Default
ko buildpushes toKO_DOCKER_REPOunless--localor--push=falseis set
Single static Go binary across macOS, Linux, and Windows via Homebrew, go install, and GitHub Releases (requires Go toolchain).
- Cross-platform binary via
brew install ko
Builds multi-arch Go container images in seconds without Dockerfiles and integrates natively with Kubernetes manifests.
- Fast cross-compilation of Go
cmd/targets straight to OCI
Official ko-build/ko project (originated at Google) licensed under Apache-2.0.
- Official
ko-build/korepository
Clear configuration docs at ko.build and clean Cobra --help.
- Official docs at ko.build
Security, Auth & Guardrails
Reads OCI registry credentials from ~/.docker/config.json and KO_DOCKER_REPO environment variables.
100% free and open-source (Apache-2.0).
# ko Agent Rules - Default to `ko build --local` or `--push=false --tarball=out.tar` for local verification; never push unless `KO_DOCKER_REPO` and push intent are confirmed. - Use `ko resolve --push=false -f <manifest>` to preview Kubernetes YAML output before running `ko apply`.
Agent-Ready Command Recipes
Safe Read-Only Queries
--push=false ko resolve --push=false -f k8s/deployment.yaml
Validates Go builds and resolves ko:// references in YAML manifests to stdout without pushing images or applying to a cluster.
Controlled Writes & Previews
ko build --local ./cmd/server
Builds a distroless OCI image under ko.local/ into the local Docker daemon without pushing remotely.
Strengths for Agents
- + Builds fast, reproducible, distroless Go OCI images with zero Dockerfile or daemon.
- + Generates SPDX SBOMs automatically by default (
--sbom=spdx). - +
ko resolve --push=falsepreviews resolved Kubernetes manifests safely.
Caveats & Pitfalls
- ! Only targets Go applications; not a general-purpose image builder.
- !
ko buildpushes toKO_DOCKER_REPOby default unless--localor--push=falseis passed.