Skip to content

Commit

Permalink
Merge pull request #233 from thaJeztah/update_readme_instructions
Browse files Browse the repository at this point in the history
Update local build instructions in README
  • Loading branch information
thaJeztah authored Aug 21, 2022
2 parents 6dfcfc1 + becf2f2 commit a9d6be0
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
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

0 comments on commit a9d6be0

Please sign in to comment.