Skip to content

Commit

Permalink
Add crane's auth command to facilitate logging into a registry (ko-bu…
Browse files Browse the repository at this point in the history
…ild#243)

* Add crane's auth command to facilitate logging into a registry

* Add documentation about `ko auth login`
  • Loading branch information
tcnghia authored Nov 9, 2020
1 parent 36a921f commit 715c03e
Show file tree
Hide file tree
Showing 28 changed files with 1,939 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@
GO111MODULE=on go get github.com/google/ko/cmd/ko
```

## Authenticating

The `ko` CLI makes extensive use of the container registry as a ubiquitous and
standard object store. However, the typical model for authenticating with a
container registry is via `docker login`, and `ko` does not require users to
install `docker` locally. To facilitate logging in without `ko` we expose:

```shell
ko auth login my.registry.io -u username --password-stdin
```

## The `ko` Model

`ko` is built around a very simple extension to Go's model for expressing
Expand Down
5 changes: 5 additions & 0 deletions cmd/ko/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"github.com/google/go-containerregistry/pkg/logs"
"github.com/google/ko/pkg/commands"

cranecmd "github.com/google/go-containerregistry/cmd/crane/cmd"
"github.com/spf13/cobra"
)

Expand All @@ -38,6 +39,10 @@ func main() {
}
commands.AddKubeCommands(cmds)

// Also add the auth group from crane to facilitate logging into a
// registry.
cmds.AddCommand(cranecmd.NewCmdAuth())

if err := cmds.Execute(); err != nil {
log.Fatalf("error during command execution: %v", err)
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 715c03e

Please sign in to comment.