dockerconfigresolver

package
v1.3.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0 Imports: 14 Imported by: 6

Documentation

Index

Constants

View Source
const IndexServer = "https://index.docker.io/v1/"

IndexServer is used for user auth and image search

From https://github.com/moby/moby/blob/v20.10.18/registry/config.go#L36-L39

Variables

View Source
var PushTracker = docker.NewInMemoryTracker()

Functions

func ConvertToHostname added in v1.0.0

func ConvertToHostname(url string) string

ConvertToHostname converts a registry url which has http|https prepended to just an hostname.

From https://github.com/moby/moby/blob/v20.10.18/registry/auth.go#L154-L167

func New

func New(ctx context.Context, refHostname string, optFuncs ...Opt) (remotes.Resolver, error)

New instantiates a resolver using $DOCKER_CONFIG/config.json .

$DOCKER_CONFIG defaults to "~/.docker".

refHostname is like "docker.io".

func NewHostOptions added in v0.16.0

func NewHostOptions(ctx context.Context, refHostname string, optFuncs ...Opt) (*dockerconfig.HostOptions, error)

NewHostOptions instantiates a HostOptions struct using $DOCKER_CONFIG/config.json .

$DOCKER_CONFIG defaults to "~/.docker".

refHostname is like "docker.io".

Types

type AuthCreds

type AuthCreds func(string) (string, string, error)

AuthCreds is for docker.WithAuthCreds

func NewAuthCreds

func NewAuthCreds(refHostname string) (AuthCreds, error)

NewAuthCreds returns AuthCreds that uses $DOCKER_CONFIG/config.json . AuthCreds can be nil.

type Opt

type Opt func(*opts)

Opt for New

func WithAuthCreds added in v0.16.0

func WithAuthCreds(ac AuthCreds) Opt

func WithHostsDirs added in v0.16.0

func WithHostsDirs(orig []string) Opt

WithHostsDirs specifies directories like /etc/containerd/certs.d and /etc/docker/certs.d

func WithPlainHTTP

func WithPlainHTTP(b bool) Opt

WithPlainHTTP enables insecure plain HTTP

func WithSkipVerifyCerts

func WithSkipVerifyCerts(b bool) Opt

WithSkipVerifyCerts skips verifying TLS certs

Jump to

Keyboard shortcuts

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