mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
Merge pull request #233 from thaJeztah/update_readme_instructions
Update local build instructions in README
This commit is contained in:
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user