Support Docker's `credsStore` (#591)

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 https://github.com/docker/cli/issues/2928
This commit is contained in:
Fedor Korotkov 2023-08-21 15:44:35 -04:00 committed by GitHub
parent f68297097e
commit f45551cbf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -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
}
@ -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 {