docker

package
v1.203.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigManager

type ConfigManager struct {
	// contains filtered or unexported fields
}

ConfigManager manages Docker config.json for ECR authentication. It uses file locking to prevent concurrent modification.

func NewConfigManager

func NewConfigManager() (*ConfigManager, error)

NewConfigManager creates a new Docker config manager using the default Docker config path. The config is stored in ~/.docker/config.json by default (or $DOCKER_CONFIG/config.json if DOCKER_CONFIG is set). This ensures compatibility with Docker CLI without requiring additional environment variable configuration.

func (*ConfigManager) GetAuthenticatedRegistries

func (m *ConfigManager) GetAuthenticatedRegistries() ([]string, error)

GetAuthenticatedRegistries returns list of authenticated ECR registries.

func (*ConfigManager) GetConfigDir

func (m *ConfigManager) GetConfigDir() string

GetConfigDir returns the directory containing the Docker config.

func (*ConfigManager) GetConfigPath

func (m *ConfigManager) GetConfigPath() string

GetConfigPath returns the full path to the Docker config file.

func (*ConfigManager) RemoveAuth

func (m *ConfigManager) RemoveAuth(registries ...string) error

RemoveAuth removes ECR authorization from Docker config.

func (*ConfigManager) WriteAuth

func (m *ConfigManager) WriteAuth(registry, username, password string) error

WriteAuth writes ECR authorization to Docker config. The auth entry is stored as base64(username:password).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL