Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update local build instructions in README #233

Merged
merged 1 commit into from Aug 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 15 additions & 8 deletions README.md
Expand Up @@ -19,35 +19,42 @@ You can build the credential helpers using Docker:
```shell
# create builder
$ docker buildx create --use

# build credential helpers from remote repository and output to ./bin/build
$ docker buildx bake "https://github.com/docker/docker-credential-helpers.git"

# or from local source
$ git clone https://github.com/docker/docker-credential-helpers.git
$ cd docker-credential-helpers
$ docker buildx bake
```

Or if the toolchain is already installed on your machine:

1 - Download the source and put it in your `$GOPATH` with `go get`.
1 - Download the source.

```
$ go get github.com/docker/docker-credential-helpers
```shell
$ git clone https://github.com/docker/docker-credential-helpers.git
$ cd docker-credential-helpers
```

2 - Use `make` to build the program you want. That will leave an executable in the `bin` directory inside the repository.

```
$ cd $GOPATH/docker/docker-credentials-helpers
```shell
$ make osxkeychain
```

3 - Put that binary in your `$PATH`, so Docker can find it.

```shell
$ cp bin/docker-credential-osxkeychain /usr/local/bin/
```

## Usage

### With the Docker Engine

Set the `credsStore` option in your `.docker/config.json` file with the suffix of the program you want to use. For instance, set it to `osxkeychain` if you want to use `docker-credential-osxkeychain`.
Set the `credsStore` option in your `~/.docker/config.json` file with the suffix of the program you want to use. For instance, set it to `osxkeychain` if you want to use `docker-credential-osxkeychain`.

```json
{
Expand Down Expand Up @@ -91,8 +98,8 @@ A credential helper can be any program that can read values from the standard in

This repository also includes libraries to implement new credentials programs in Go. Adding a new helper program is pretty easy. You can see how the OS X keychain helper works in the [osxkeychain](osxkeychain) directory.

1. Implement the interface `credentials.Helper` in `YOUR_PACKAGE/YOUR_PACKAGE_$GOOS.go`
2. Create a main program in `YOUR_PACKAGE/cmd/main_$GOOS.go`.
1. Implement the interface `credentials.Helper` in `YOUR_PACKAGE/`
2. Create a main program in `YOUR_PACKAGE/cmd/`.
3. Add make tasks to build your program and run tests.

## License
Expand Down