Skip to content

Commit

Permalink
Document --platform flag in README.md (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
imjasonh committed Oct 14, 2020
1 parent 2c4d755 commit 3691164
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,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=<some-OS>/<some-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:
Expand Down

0 comments on commit 3691164

Please sign in to comment.