public class ContainerRegistryAuthSupplier extends Object implements RegistryAuthSupplier
To construct a new instance, use
fromStream(InputStream) to get a ContainerRegistryAuthSupplier.Builder if you
have credentials for the account to use, or you can use
forApplicationDefaultCredentials()
if you would like to use
the
Application Default Credentials.
The scopes used to fetch an access token and the minimum expiry time can be configured via the
Builder before calling ContainerRegistryAuthSupplier.Builder.build().
| Modifier and Type | Class and Description |
|---|---|
static class |
ContainerRegistryAuthSupplier.Builder
A Builder of ContainerRegistryAuthSupplier.
|
| Modifier and Type | Method and Description |
|---|---|
RegistryAuth |
authFor(String imageName)
Returns a RegistryAuth object that works with a given registry's API [e.g.
|
RegistryConfigs |
authForBuild()
Authentication info to pass in the X-Registry-Config header when building an image.
|
RegistryAuth |
authForSwarm()
Returns a RegistryAuth object that is valid for a Docker Swarm context [i.e.
|
static ContainerRegistryAuthSupplier.Builder |
forApplicationDefaultCredentials()
Constructs a ContainerRegistryAuthSupplier using the Application Default Credentials.
|
static ContainerRegistryAuthSupplier.Builder |
forCredentials(com.google.auth.oauth2.GoogleCredentials credentials)
Constructs a ContainerRegistryAuthSupplier using the specified credentials.
|
static ContainerRegistryAuthSupplier.Builder |
fromStream(InputStream credentialsStream)
Constructs a ContainerRegistryAuthSupplier for the account with the given credentials.
|
public static ContainerRegistryAuthSupplier.Builder fromStream(InputStream credentialsStream) throws IOException
IOExceptionContainerRegistryAuthSupplier.Builderpublic static ContainerRegistryAuthSupplier.Builder forApplicationDefaultCredentials() throws IOException
IOExceptionContainerRegistryAuthSupplier.Builderpublic static ContainerRegistryAuthSupplier.Builder forCredentials(com.google.auth.oauth2.GoogleCredentials credentials)
ContainerRegistryAuthSupplier.Builderpublic RegistryAuth authFor(String imageName) throws DockerException
RegistryAuthSupplierauthFor in interface RegistryAuthSuppliernull if no
authentication info applies for this imageDockerExceptionpublic RegistryAuth authForSwarm() throws DockerException
RegistryAuthSupplierauthForSwarm in interface RegistryAuthSuppliernull for no authentication infoDockerExceptionpublic RegistryConfigs authForBuild() throws DockerException
RegistryAuthSupplierauthForBuild in interface RegistryAuthSupplierDockerExceptionCopyright © 2019. All rights reserved.