cli: Index | Files

package configfile

import ""


Package Files


type ConfigFile Uses

type ConfigFile struct {
    AuthConfigs          map[string]types.AuthConfig  `json:"auths"`
    HTTPHeaders          map[string]string            `json:"HttpHeaders,omitempty"`
    PsFormat             string                       `json:"psFormat,omitempty"`
    ImagesFormat         string                       `json:"imagesFormat,omitempty"`
    NetworksFormat       string                       `json:"networksFormat,omitempty"`
    PluginsFormat        string                       `json:"pluginsFormat,omitempty"`
    VolumesFormat        string                       `json:"volumesFormat,omitempty"`
    StatsFormat          string                       `json:"statsFormat,omitempty"`
    DetachKeys           string                       `json:"detachKeys,omitempty"`
    CredentialsStore     string                       `json:"credsStore,omitempty"`
    CredentialHelpers    map[string]string            `json:"credHelpers,omitempty"`
    Filename             string                       `json:"-"` // Note: for internal use only
    ServiceInspectFormat string                       `json:"serviceInspectFormat,omitempty"`
    ServicesFormat       string                       `json:"servicesFormat,omitempty"`
    TasksFormat          string                       `json:"tasksFormat,omitempty"`
    SecretFormat         string                       `json:"secretFormat,omitempty"`
    ConfigFormat         string                       `json:"configFormat,omitempty"`
    NodesFormat          string                       `json:"nodesFormat,omitempty"`
    PruneFilters         []string                     `json:"pruneFilters,omitempty"`
    Proxies              map[string]ProxyConfig       `json:"proxies,omitempty"`
    Experimental         string                       `json:"experimental,omitempty"`
    StackOrchestrator    string                       `json:"stackOrchestrator,omitempty"`
    Kubernetes           *KubernetesConfig            `json:"kubernetes,omitempty"`
    CurrentContext       string                       `json:"currentContext,omitempty"`
    CLIPluginsExtraDirs  []string                     `json:"cliPluginsExtraDirs,omitempty"`
    Plugins              map[string]map[string]string `json:"plugins,omitempty"`
    Aliases              map[string]string            `json:"aliases,omitempty"`

ConfigFile ~/.docker/config.json file info

func New Uses

func New(fn string) *ConfigFile

New initializes an empty configuration file for the given filename 'fn'

func (*ConfigFile) ContainsAuth Uses

func (configFile *ConfigFile) ContainsAuth() bool

ContainsAuth returns whether there is authentication configured in this file or not.

func (*ConfigFile) GetAllCredentials Uses

func (configFile *ConfigFile) GetAllCredentials() (map[string]types.AuthConfig, error)

GetAllCredentials returns all of the credentials stored in all of the configured credential stores.

func (*ConfigFile) GetAuthConfig Uses

func (configFile *ConfigFile) GetAuthConfig(registryHostname string) (types.AuthConfig, error)

GetAuthConfig for a repository from the credential store

func (*ConfigFile) GetAuthConfigs Uses

func (configFile *ConfigFile) GetAuthConfigs() map[string]types.AuthConfig

GetAuthConfigs returns the mapping of repo to auth configuration

func (*ConfigFile) GetCredentialsStore Uses

func (configFile *ConfigFile) GetCredentialsStore(registryHostname string) credentials.Store

GetCredentialsStore returns a new credentials store from the settings in the configuration file

func (*ConfigFile) GetFilename Uses

func (configFile *ConfigFile) GetFilename() string

GetFilename returns the file name that this config file is based on.

func (*ConfigFile) LegacyLoadFromReader Uses

func (configFile *ConfigFile) LegacyLoadFromReader(configData io.Reader) error

LegacyLoadFromReader reads the non-nested configuration data given and sets up the auth config information with given directory and populates the receiver object

func (*ConfigFile) LoadFromReader Uses

func (configFile *ConfigFile) LoadFromReader(configData io.Reader) error

LoadFromReader reads the configuration data given and sets up the auth config information with given directory and populates the receiver object

func (*ConfigFile) ParseProxyConfig Uses

func (configFile *ConfigFile) ParseProxyConfig(host string, runOpts map[string]*string) map[string]*string

ParseProxyConfig computes proxy configuration by retrieving the config for the provided host and then checking this against any environment variables provided to the container

func (*ConfigFile) PluginConfig Uses

func (configFile *ConfigFile) PluginConfig(pluginname, option string) (string, bool)

PluginConfig retrieves the requested option for the given plugin.

func (*ConfigFile) Save Uses

func (configFile *ConfigFile) Save() error

Save encodes and writes out all the authorization information

func (*ConfigFile) SaveToWriter Uses

func (configFile *ConfigFile) SaveToWriter(writer io.Writer) error

SaveToWriter encodes and writes out all the authorization information to the given writer

func (*ConfigFile) SetPluginConfig Uses

func (configFile *ConfigFile) SetPluginConfig(pluginname, option, value string)

SetPluginConfig sets the option to the given value for the given plugin. Passing a value of "" will remove the option. If removing the final config item for a given plugin then also cleans up the overall plugin entry.

type KubernetesConfig Uses

type KubernetesConfig struct {
    AllNamespaces string `json:"allNamespaces,omitempty"`

KubernetesConfig contains Kubernetes orchestrator settings

type ProxyConfig Uses

type ProxyConfig struct {
    HTTPProxy  string `json:"httpProxy,omitempty"`
    HTTPSProxy string `json:"httpsProxy,omitempty"`
    NoProxy    string `json:"noProxy,omitempty"`
    FTPProxy   string `json:"ftpProxy,omitempty"`

ProxyConfig contains proxy configuration settings

Package configfile imports 11 packages (graph) and is imported by 116 packages. Updated 2019-10-25. Refresh now. Tools for package owners.