Class DockerConfigReader


  • public class DockerConfigReader
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.String AUTHS_ENTRY  
      private static java.lang.String CREDS_STORE  
      private static org.slf4j.Logger LOG  
      private static com.fasterxml.jackson.databind.ObjectMapper MAPPER  
    • Field Detail

      • LOG

        private static final org.slf4j.Logger LOG
      • MAPPER

        private static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
    • Constructor Detail

      • DockerConfigReader

        public DockerConfigReader()
    • Method Detail

      • fromConfig

        public RegistryConfigs fromConfig​(java.nio.file.Path configPath)
                                   throws java.io.IOException
        Returns all RegistryConfig instances from the configuration file.
        Throws:
        java.io.IOException
      • fromConfig

        public RegistryAuth fromConfig​(java.nio.file.Path configPath,
                                       java.lang.String serverAddress)
                                throws java.io.IOException
        Returns the RegistryAuth for the config file for the given registry server name.
        Throws:
        java.lang.IllegalArgumentException - if the config file does not contain registry auth info for the registry
        java.io.IOException
      • fromFirstConfig

        @Deprecated
        public RegistryAuth fromFirstConfig​(java.nio.file.Path configPath)
                                     throws java.io.IOException
        Deprecated.
        do not use - only exists for backwards compatibility. Use fromConfig(Path) instead.
        Throws:
        java.io.IOException
      • parseDockerConfig

        private RegistryAuth parseDockerConfig​(java.nio.file.Path configPath,
                                               java.lang.String serverAddress)
                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDockerConfig

        private RegistryConfigs parseDockerConfig​(java.nio.file.Path configPath)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • defaultConfigPath

        public java.nio.file.Path defaultConfigPath()
      • extractAuthJson

        private com.fasterxml.jackson.databind.node.ObjectNode extractAuthJson​(java.nio.file.Path configPath)
                                                                        throws java.io.IOException
        Throws:
        java.io.IOException