docker

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 25 Imported by: 25

Documentation

Index

Constants

View Source
const IndexHostname = "index.docker.io"

Variables

This section is empty.

Functions

func NewClient

func NewClient(configPaths ...string) (auth.Client, error)

NewClient creates a new auth client based on provided config paths. If not config path is provided, the default path is used. Credentials are read from the first config and fall backs to next. All changes will only be written to the first config file.

func NewClientWithDockerFallback added in v1.1.0

func NewClientWithDockerFallback(configPaths ...string) (auth.Client, error)

NewClientWithDockerFallback creates a new auth client which falls back on Docker's default config path. This allows support for ~/.docker/config.json as a fallback, as well as support for the DOCKER_CONFIG environment variable.

Types

type Client

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

Client provides authentication operations for docker registries.

func (*Client) Credential

func (c *Client) Credential(hostname string) (string, string, error)

Credential returns the login credential of the request host.

func (*Client) Login

func (c *Client) Login(ctx context.Context, hostname, username, secret string, insecure bool) error

Login logs in to a docker registry identified by the hostname. Deprecated: use LoginWithOpts

func (*Client) LoginWithOpts

func (c *Client) LoginWithOpts(options ...iface.LoginOption) error

LoginWithOpts logs in to a docker registry identified by the hostname with custom options.

func (*Client) Logout

func (c *Client) Logout(_ context.Context, hostname string) error

Logout logs out from a docker registry identified by the hostname.

func (*Client) Resolver

func (c *Client) Resolver(_ context.Context, client *http.Client, plainHTTP bool) (remotes.Resolver, error)

Resolver returns a new authenticated resolver. Deprecated: use ResolverWithOpts

func (*Client) ResolverWithOpts

func (c *Client) ResolverWithOpts(options ...iface.ResolverOption) (remotes.Resolver, error)

ResolverWithOpts returns a new authenticated resolver with custom options.

Jump to

Keyboard shortcuts

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