Skip to content

Commit

Permalink
Support Docker's credsStore (#591)
Browse files Browse the repository at this point in the history
This way for #581 we don't need to specify a fully quialified URL and can simply use the following `~/.docker/config.json`:

```json
{
	"credsStore": "ecr-login"
}
```

Related to docker/cli#2928
  • Loading branch information
fkorotkov authored Aug 21, 2023
1 parent f682970 commit f45551c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ class DockerConfigCredentialsProvider: CredentialsProvider {
return try executeHelper(binaryName: "docker-credential-\(helperProgram)", host: host)
}

if let defaultCredsStore = config.credsStore {
return try executeHelper(binaryName: "docker-credential-\(defaultCredsStore)", host: host)
}

return nil
}

Expand Down Expand Up @@ -59,6 +63,7 @@ class DockerConfigCredentialsProvider: CredentialsProvider {
struct DockerConfig: Codable {
var auths: Dictionary<String, DockerAuthConfig>? = Dictionary()
var credHelpers: Dictionary<String, String>? = Dictionary()
var credsStore: String? = nil
}

struct DockerAuthConfig: Codable {
Expand Down

0 comments on commit f45551c

Please sign in to comment.