ko resolve

ko resolve

Print the input files with image references resolved to built/pushed image digests.

Synopsis

This sub-command finds import path references within the provided files, builds them into Go binaries, containerizes them, publishes them, and prints the resulting yaml.

  1. ko resolve -f FILENAME [flags]

Examples

  1. # Build and publish import path references to a Docker
  2. # Registry as:
  3. # ${KO_DOCKER_REPO}/<package name>-<hash of import path>
  4. # When KO_DOCKER_REPO is ko.local, it is the same as if
  5. # --local and --preserve-import-paths were passed.
  6. ko resolve -f config/
  7. # Build and publish import path references to a Docker
  8. # Registry preserving import path names as:
  9. # ${KO_DOCKER_REPO}/<import path>
  10. # When KO_DOCKER_REPO is ko.local, it is the same as if
  11. # --local was passed.
  12. ko resolve --preserve-import-paths -f config/
  13. # Build and publish import path references to a Docker
  14. # daemon as:
  15. # ko.local/<import path>
  16. # This always preserves import paths.
  17. ko resolve --local -f config/

Options

  1. --bare Whether to just use KO_DOCKER_REPO without additional context (may not work properly with --tags).
  2. -B, --base-import-paths Whether to use the base path without MD5 hash after KO_DOCKER_REPO (may not work properly with --tags).
  3. --disable-optimizations Disable optimizations when building Go code. Useful when you want to interactively debug the created container.
  4. -f, --filename strings Filename, directory, or URL to files to use to create the resource
  5. -h, --help help for resolve
  6. --image-label strings Which labels (key=value) to add to the image.
  7. --image-refs string Path to file where a list of the published image references will be written.
  8. --insecure-registry Whether to skip TLS verification on the registry
  9. -j, --jobs int The maximum number of concurrent builds (default GOMAXPROCS)
  10. -L, --local Load into images to local docker daemon.
  11. --oci-layout-path string Path to save the OCI image layout of the built images
  12. --platform strings Which platform to use when pulling a multi-platform base. Format: all | <os>[/<arch>[/<variant>]][,platform]*
  13. -P, --preserve-import-paths Whether to preserve the full import path after KO_DOCKER_REPO.
  14. --push Push images to KO_DOCKER_REPO (default true)
  15. -R, --recursive Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory.
  16. --sbom string The SBOM media type to use (none will disable SBOM synthesis and upload, also supports: spdx, cyclonedx, go.version-m). (default "spdx")
  17. --sbom-dir string Path to file where the SBOM will be written.
  18. -l, --selector string Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
  19. --tag-only Include tags but not digests in resolved image references. Useful when digests are not preserved when images are repopulated.
  20. -t, --tags strings Which tags to use for the produced image instead of the default 'latest' tag (may not work properly with --base-import-paths or --bare). (default [latest])
  21. --tarball string File to save images tarballs

Options inherited from parent commands

  1. -v, --verbose Enable debug logs

SEE ALSO

  • ko - Rapidly iterate with Go, Containers, and Kubernetes.