From a32ced212a2af5deec01079ac0d93e589716e6c0 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Wed, 30 Sep 2020 13:47:46 -0400 Subject: [PATCH] Document `--platform` flag in README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 43c305eea1..4dec5d3a84 100644 --- a/README.md +++ b/README.md @@ -439,6 +439,25 @@ kubectl logs kodata 2018/07/19 23:38:29 Hello there ``` +## Multi-Platform Images + +If `ko` is invoked with `--platform=all`, for any image that it builds that is +based on a multi-architecture image (e.g., the default +`gcr.io/distroless/static:nonroot`, `busybox`, `alpine`, etc.), `ko` will +attempt to build the Go binary using Go's cross-compilation support and produce +a multi-architecture [image +index](https://github.com/opencontainers/image-spec/blob/master/image-index.md) +(aka "manifest list"), with support for each OS and architecture pair supported +by the base image. + +If `ko` is invoked with `--platform=/` (e.g., +`--platform=linux/amd64` or `--platform=linux/arm64`), then it will attempt to +build an image for that OS and architecture only, assuming the base image +supports it. + +When `--platform` is not provided, `ko` builds an image with the OS and +architecture based on the build environment's `GOOS` and `GOARCH`. + ## Enable Autocompletion To generate an bash completion script, you can run: