docker

package
v0.1.5-rc Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

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) 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