pub struct DockerConfig {
pub auths: HashMap<String, AuthEntry>,
pub creds_store: Option<String>,
pub cred_helpers: HashMap<String, String>,
}Expand description
Docker config file structure.
This represents the contents of ~/.docker/config.json or the file
pointed to by DOCKER_CONFIG.
Fields§
§auths: HashMap<String, AuthEntry>Direct authentication entries (base64-encoded or plaintext).
creds_store: Option<String>Default credential store for all registries.
cred_helpers: HashMap<String, String>Per-registry credential helpers.
Implementations§
Source§impl DockerConfig
impl DockerConfig
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Loads the Docker config from the default location.
Checks DOCKER_CONFIG environment variable first, then falls back
to ~/.docker/config.json.
Sourcepub fn default_config_path() -> Result<PathBuf>
pub fn default_config_path() -> Result<PathBuf>
Returns the default Docker config file path.
Checks DOCKER_CONFIG environment variable first, then uses
~/.docker/config.json.
Sourcepub fn get_credential_helper(&self, registry: &str) -> Option<&str>
pub fn get_credential_helper(&self, registry: &str) -> Option<&str>
Gets the credential helper name for a registry.
Returns the registry-specific helper from credHelpers if present,
otherwise falls back to credsStore.
Sourcepub fn get_auth(&self, registry: &str) -> Option<Credential>
pub fn get_auth(&self, registry: &str) -> Option<Credential>
Gets credentials from the auths section for a registry.
Trait Implementations§
Source§impl Clone for DockerConfig
impl Clone for DockerConfig
Source§fn clone(&self) -> DockerConfig
fn clone(&self) -> DockerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DockerConfig
impl Debug for DockerConfig
Source§impl Default for DockerConfig
impl Default for DockerConfig
Source§fn default() -> DockerConfig
fn default() -> DockerConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DockerConfig
impl<'de> Deserialize<'de> for DockerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DockerConfig
impl RefUnwindSafe for DockerConfig
impl Send for DockerConfig
impl Sync for DockerConfig
impl Unpin for DockerConfig
impl UnsafeUnpin for DockerConfig
impl UnwindSafe for DockerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more