Interface RegistryAuth
@Immutable
public interface RegistryAuth
Represents all the auth info for a particular registry.
These are sent to docker during authenticated registry operations
in the X-Registry-Config header (see RegistryConfigs
).
Typically these objects are built by requesting auth information from a
DockerCredentialHelper
. However, in older less-secure
docker versions, these can be written directly into the ~/.docker/config.json file,
with the username and password joined with a ":" and base-64 encoded.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RegistryAuth.Builder
builder()
static RegistryAuth
create
(String username, String password, String email, String serveraddress, String identitytoken, String auth) email()
static RegistryAuth.Builder
static RegistryAuth.Builder
fromDockerConfig
(String serverAddress) This function looks for and parses credentials for logging into the Docker registry specified by serverAddress.password()
default RegistryAuth.Builder
username()
-
Method Details
-
username
String username() -
password
-
email
- Returns:
- Unused but must be a well-formed email address (e.g. [email protected]).
-
serverAddress
String serverAddress() -
identityToken
String identityToken() -
toBuilder
-
fromDockerConfig
This function looks for and parses credentials for logging into the Docker registry specified by serverAddress. We first look in ~/.docker/config.json and fallback to ~/.dockercfg. These files are created from running `docker login`.- Parameters:
serverAddress
- A string representing the server address- Returns:
- a
RegistryAuth.Builder
- Throws:
IOException
- when we can't parse the docker config file
-
create
-
forAuth
- Parameters:
auth
- the "auth" field of the docker client config file.- Returns:
- Construct a Builder based upon the "auth" field of the docker client config file.
-
builder
-