Class DockerConfigReader


  • public class DockerConfigReader
    extends Object
    • Constructor Detail

      • DockerConfigReader

        public DockerConfigReader()
    • Method Detail

      • 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()