Class DockerConfigReader

java.lang.Object
org.mandas.docker.client.DockerConfigReader

public class DockerConfigReader extends Object
  • Constructor Details

    • DockerConfigReader

      public DockerConfigReader()
  • Method Details

    • anyRegistryAuth

      public RegistryAuth anyRegistryAuth() throws IOException
      Return a single RegistryAuth from the default config file. If there is only one, it'll be that one.
      Returns:
      Some registry auth value.
      Throws:
      IOException - when an error occured during reading for docker configuration
    • authForAllRegistries

      public RegistryConfigs authForAllRegistries(Path configPath) throws IOException
      Parse the contents of the config file and generate all possible RegistryAuths, which are bundled into a RegistryConfigs instance.
      Parameters:
      configPath - Path to config file.
      Returns:
      All registry auths that can be generated from the config file
      Throws:
      IOException - If the file cannot be read, or its JSON cannot be parsed
    • authForRegistry

      public RegistryAuth authForRegistry(Path configPath, String registry) throws IOException
      Generate RegistryAuth for the registry.
      Parameters:
      configPath - Path to the docker config file
      registry - Docker registry for which to generate auth
      Returns:
      The generated authentication object
      Throws:
      IOException - when an error occured while reading the docker configuration
    • defaultConfigPath

      public Path defaultConfigPath()