docker

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDigestFromCanonical

func GetDigestFromCanonical(client *http.Client, image reference.Canonical) (digest.Digest, error)

GetDigestFromCanonical gets an image's digest from the passed canonical image. Returns a digest.Digest, or an error.

func GetDigestFromTagged

func GetDigestFromTagged(client *http.Client, image reference.NamedTagged) (digest.Digest, error)

GetDigestFromTagged gets an image's digest from the passed tag. Returns a digest.Digest, or an error.

func NewConfigError

func NewConfigError(err error) error

NewConfigError creates a new APIError specific to docker config requests. This version wraps the passed error.

func NewConfigErrorWithRequest

func NewConfigErrorWithRequest(status string, b []byte) error

NewConfigErrorWithRequest creates a new APIError specific to docker config requests. This version wraps the passed HTTP response.

func NewManifestError

func NewManifestError(err error) error

NewManifestError creates a new APIError specific to docker manifest requests. This version wraps the passed error.

func NewManifestErrorWithRequest

func NewManifestErrorWithRequest(status string, b []byte) error

NewManifestErrorWithRequest creates a new APIError specific to docker manifest requests. This version wraps the passed HTTP response.

func RequestManifest

func RequestManifest(client *http.Client, ref reference.Canonical) (distribution.Manifest, error)

RequestManifest requests an Manifest for the passed canonical image reference (an image URL with a digest specifying the built image). Returns a schema2.Manifest, or an error if there's an issue.

Types

type APIError

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

APIError is a generic error structure representing a docker API call error. It tracks the type of request that failed, and either wraps an error or contains the body of an API call.

func (*APIError) Error

func (err *APIError) Error() string

Error returns the docker API error as a string.

type ImageConfig

type ImageConfig interface {
	// RunsAsRoot returns true if the passed image will run as the root user.
	RunsAsRoot() bool
}

ImageConfig represents an Docker image configuration. This presently just allows us to verify if an image runs as root or not.

func RequestImageConfig

func RequestImageConfig(client *http.Client, ref reference.Canonical) (ImageConfig, error)

RequestImageConfig requests an image configuration from the server, based on the passed reference. Returns an ImageConfig or an error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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