Skip to content

Commit

Permalink
update docs: fix broken links, align with README (ko-build#854)
Browse files Browse the repository at this point in the history
* update docs: fix broken links, align with README

* update google/ko references that can be updated
  • Loading branch information
imjasonh authored Oct 18, 2022
1 parent 761e25d commit 43cdbd2
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 24 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# `ko`: Easy Go Containers

[![GitHub Actions Build Status](https://github.com/google/ko/workflows/Build/badge.svg)](https://github.com/google/ko/actions?query=workflow%3ABuild)
[![GitHub Actions Build Status](https://github.com/ko-build/ko/workflows/Build/badge.svg)](https://github.com/ko-build/ko/actions?query=workflow%3ABuild)
[![GoDoc](https://godoc.org/github.com/google/ko?status.svg)](https://godoc.org/github.com/google/ko)
[![Go Report Card](https://goreportcard.com/badge/google/ko)](https://goreportcard.com/report/google/ko)
[![Go Report Card](https://goreportcard.com/badge/ko-build/ko)](https://goreportcard.com/report/ko-build/ko)
[![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev/images/gh-badge-level3.svg)

<img src="./logo/ko.png" width="300">
Expand All @@ -24,7 +24,7 @@ tool for Kubernetes applications ([See below](#Kubernetes-Integration)).

## Install

### Install from [Releases](https://github.com/google/ko/releases)
### Install from [GitHub Releases](https://github.com/ko-build/ko/releases)

```
$ VERSION=TODO # choose the latest version
Expand All @@ -36,8 +36,8 @@ We generate [SLSA3 provenance](slsa.dev) using the OpenSSF's [slsa-framework/sls


```shell
$ curl -sL "https://github.com/google/ko/releases/download/v${VERSION}/ko_${VERSION}_${OS}_${ARCH}.tar.gz" > ko.tar.gz
$ curl -sL https://github.com/google/ko/releases/download/v${VERSION}/attestation.intoto.jsonl > provenance.intoto.jsonl
$ curl -sL "https://github.com/ko-build/ko/releases/download/v${VERSION}/ko_${VERSION}_${OS}_${ARCH}.tar.gz" > ko.tar.gz
$ curl -sL https://github.com/ko-build/ko/releases/download/v${VERSION}/attestation.intoto.jsonl > provenance.intoto.jsonl
$ slsa-verifier -artifact-path ko.tar.gz -provenance provenance.intoto.jsonl -source github.com/google/ko -tag "v${VERSION}"
PASSED: Verified SLSA provenance
```
Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Oh, you betcha. Here's a partial list:
- `ko` extension for [Tilt](https://github.com/tilt-dev/tilt-extensions/tree/master/ko)
- `ko` support for [goreleaser](https://github.com/goreleaser/goreleaser/pull/2564) (proposed)

## Does `ko` work with [OpenShift Internal Registry](https://docs.openshift.com/container-platform/latest/registry/registry-options.html#registry-integrated-openshift-registry_registry-options)?
## Does `ko` work with [OpenShift Internal Registry](https://access.redhat.com/documentation/en-us/openshift_container_platform/4.11/html/registry/registry-overview#registry-integrated-openshift-registry_registry-overview)?

Yes! Follow these steps:

Expand Down
2 changes: 1 addition & 1 deletion docs/advanced/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This means `ko` is ideal when you don't require [cgo](https://pkg.go.dev/cmd/cgo), and builds are executed with `CGO_ENABLED=0` by default.

To install other OS packages, make those available in your [configured base image](./../configuration).
To install other OS packages, make those available in your [configured base image](../../configuration).

`ko` only supports Go applications.
For a similar tool targeting Java applications, try [Jib](https://github.com/GoogleContainerTools/jib).
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/migrating-from-dockerfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ After running `docker build` on this `Dockerfile`, don't forget to push that ima

## Migrating to `ko`

If your Go source is laid out as described in the tutorial, and you've [installed](./../install) and [set up your environment](./../get-started), you can simply run `ko build ./` to build and push the container image to your registry.
If your Go source is laid out as described in the tutorial, and you've [installed](../../install) and [set up your environment](../../get-started), you can simply run `ko build ./` to build and push the container image to your registry.

You're done. You can delete your `Dockerfile` and uninstall `docker`.

`ko` takes advantage of your local [Go build cache](./../features/build-cache) without needing to be told to, and it sets the `ENTRYPOINT` and uses a nonroot distroless base image by default.
`ko` takes advantage of your local [Go build cache](../../features/build-cache) without needing to be told to, and it sets the `ENTRYPOINT` and uses a nonroot distroless base image by default.

To build a multi-arch image, simply add `--platform=all`.
Compare this to the [equivalent Docker instructions](https://docs.docker.com/desktop/multi-arch/).
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deployment

_See [Kubernetes Integration](./features/k8s) for information about deploying to Kubernetes._
_See [Kubernetes Integration](../features/k8s) for information about deploying to Kubernetes._

Because the output of `ko build` is an image reference, you can easily pass it to other tools that expect to take an image reference.

Expand Down
5 changes: 5 additions & 0 deletions docs/features/k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ using `ko apply`:
ko apply -f config/
```

Also, any flags passed after `--` are passed to `kubectl apply` directly, for example to specify context and kubeconfig:
```
ko apply -f config -- --context=foo --kubeconfig=cfg.yaml
```

**NB:** This requires that `kubectl` is available.

## `ko delete`
Expand Down
2 changes: 1 addition & 1 deletion docs/features/multi-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ This will instruct `ko` to look up all the supported platforms in the base image
You can also select specific platforms, for example, `--platform=linux/amd64,linux/arm64`.

`ko` also has experimental support for building for Windows images.
See [FAQ](./../advanced/faq#can-i-build-windows-containers).
See [FAQ](../../advanced/faq#can-i-build-windows-containers).

27 changes: 20 additions & 7 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
# Installation

### Install from [GitHub Releases](https://github.com/google/ko/releases)
### Install from [GitHub Releases](https://github.com/ko-build/ko/releases)

```plaintext
VERSION=TODO # choose the latest version
OS=Linux # or Darwin, Windows
ARCH=x86_64 # or arm64, i386, s390x
curl -L https://github.com/google/ko/releases/download/v${VERSION}/ko_${VERSION}_${OS}_${ARCH}.tar.gz | tar xzf - ko
chmod +x ./ko
```
$ VERSION=TODO # choose the latest version
$ OS=Linux # or Darwin
$ ARCH=x86_64 # or arm64, i386, s390x
```

We generate [SLSA3 provenance](slsa.dev) using the OpenSSF's [slsa-framework/slsa-github-generator](https://github.com/slsa-framework/slsa-github-generator). To verify our release, install the verification tool from [slsa-framework/slsa-verifier#installation](https://github.com/slsa-framework/slsa-verifier#installation) and verify as follows:


```shell
$ curl -sL "https://github.com/ko-build/ko/releases/download/v${VERSION}/ko_${VERSION}_${OS}_${ARCH}.tar.gz" > ko.tar.gz
$ curl -sL https://github.com/ko-build/ko/releases/download/v${VERSION}/attestation.intoto.jsonl > provenance.intoto.jsonl
$ slsa-verifier -artifact-path ko.tar.gz -provenance provenance.intoto.jsonl -source github.com/google/ko -tag "v${VERSION}"
PASSED: Verified SLSA provenance
```

```shell
$ tar xzf ko.tar.gz ko
$ chmod +x ./ko
```

### Install using [Homebrew](https://brew.sh)
Expand Down
2 changes: 1 addition & 1 deletion internal/sbom/sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func massageGoVersionM(b []byte) ([]byte, error) {
if !scanner.Scan() {
// Input was malformed, and doesn't contain any newlines (it
// may even be empty). This seems to happen on Windows
// (https://github.com/google/ko/issues/535) and in unit tests.
// (https://github.com/ko-build/ko/issues/535) and in unit tests.
// Just proceed with an empty output for now, and SBOMs will be empty.
// TODO: This should be an error.
return nil, nil
Expand Down
4 changes: 2 additions & 2 deletions pkg/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
type Interface interface {
// QualifyImport turns relative importpath references into complete importpaths.
// It also adds the ko scheme prefix if necessary.
// E.g., "github.com/google/ko/test" => "ko://github.com/google/ko/test"
// and "./test" => "ko://github.com/google/ko/test"
// E.g., "github.com/ko-build/ko/test" => "ko://github.com/ko-build/ko/test"
// and "./test" => "ko://github.com/ko-build/ko/test"
QualifyImport(string) (string, error)

// IsSupportedReference determines whether the given reference is to an
Expand Down
2 changes: 1 addition & 1 deletion pkg/build/gobuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ func (g *gobuild) buildOne(ctx context.Context, refStr string, base v1.Image, pl
updatePath(cfg, appDir)
cfg.Config.Env = append(cfg.Config.Env, "KO_DATA_PATH="+kodataRoot)
}
cfg.Author = "github.com/google/ko"
cfg.Author = "github.com/ko-build/ko"

if cfg.Config.Labels == nil {
cfg.Config.Labels = map[string]string{}
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ func ResolveFilesToWriter(
}

// Make sure we exit with an error.
// See https://github.com/google/ko/issues/84
// See https://github.com/ko-build/ko/issues/84
return errs.Wait()
}

Expand Down
2 changes: 1 addition & 1 deletion test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func main() {
// with the go build tag `timetzdata`. Since we want to test
// loading tzdata provided by the base image below, we'll just
// skip that for Windows here.
// See https://github.com/google/ko/issues/739
// See https://github.com/ko-build/ko/issues/739
log.Println("skipping timezone conversion on Windows")
} else {
// Exercise timezone conversions, which demonstrates tzdata is provided
Expand Down

0 comments on commit 43cdbd2

Please sign in to comment.