docker

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package docker provides primitives for working with Docker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServerFromDockerAuthKey

func GetServerFromDockerAuthKey(key string) (string, error)

GetServerFromDockerAuthKey returns the registry server for the specified Docker auth key.

In ~/.docker/config.json auth keys can be specified as URLs or host names. For the sake of comparison we need to normalize the registry identifier.

func GetServerFromImageRef

func GetServerFromImageRef(imageRef string) (string, error)

GetServerFromImageRef returns registry server from the specified imageRef.

Types

type Auth

type Auth struct {
	Auth     BasicAuth `json:"auth,omitempty"`
	Username string    `json:"username,omitempty"`
	Password string    `json:"password,omitempty"`
}

Auth represent credentials used to login to a Docker registry.

func (Auth) String

func (v Auth) String() string

type BasicAuth

type BasicAuth string

func NewBasicAuth

func NewBasicAuth(username, password string) BasicAuth

func (*BasicAuth) Decode

func (v *BasicAuth) Decode() (string, string, error)

func (*BasicAuth) Encode

func (v *BasicAuth) Encode(username, password string)

func (BasicAuth) String

func (v BasicAuth) String() string

type Config

type Config struct {
	Auths map[string]Auth `json:"auths"`
}

Config represents Docker configuration which is typically saved as `~/.docker/config.json`.

func (*Config) Read

func (c *Config) Read(contents []byte, isLegacy bool) error

func (Config) Write

func (c Config) Write() ([]byte, error)

Jump to

Keyboard shortcuts

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