docker

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

This docker package provides primitives for working with Docker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetServerFromDockerAuthKey added in v0.9.1

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 added in v0.3.0

func GetServerFromImageRef(imageRef string) (string, error)

GetServerFromImageRef returns registry server from the specified imageRef.

Types

type Auth added in v0.3.0

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 added in v0.3.0

func (v Auth) String() string

type BasicAuth added in v0.3.0

type BasicAuth string

func NewBasicAuth added in v0.3.0

func NewBasicAuth(username, password string) BasicAuth

func (*BasicAuth) Decode added in v0.3.0

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

func (*BasicAuth) Encode added in v0.3.0

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

func (BasicAuth) String added in v0.3.0

func (v BasicAuth) String() string

type Config added in v0.3.0

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

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

func (*Config) Read added in v0.3.0

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

func (Config) Write added in v0.3.0

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

Jump to

Keyboard shortcuts

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