Documentation
¶
Index ¶
- func Extract(tarFile, architecture, OS, destination string) error
- func PullPlatform(ctx context.Context, image, destination, requiredOs, requiredArch string, ...) error
- func ResolveDigest(ctx context.Context, ref string, mirrors []string, creds Credentials) (string, error)
- type Credentials
- type ManifestNotFoundError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Extract ¶
Extract all files from a `docker save` tarFile matching a given architecture and OS to destination. Note this doesn't handle files which have been deleted in layers.
func PullPlatform ¶
func PullPlatform(ctx context.Context, image, destination, requiredOs, requiredArch string, mirrors []string, creds Credentials) error
PullPlatform downloads image for the given OS/architecture and writes it to destination as a tarball. Mirrors are tried before registry-1.docker.io for Docker Hub references. When creds is nil, credentials are resolved from the environment and ~/.docker/config.json.
func ResolveDigest ¶ added in v1.2.4
func ResolveDigest(ctx context.Context, ref string, mirrors []string, creds Credentials) (string, error)
ResolveDigest resolves the given image reference (e.g. "registry-1.docker.io/docker/foo:tag") against the registry (with optional mirrors tried first for Docker Hub references) and returns the resolved digest. It does not download any blobs; it issues only the manifest HEAD/GET that the registry resolver needs.
Authentication uses the same credentials lookup as PullPlatform: creds when non-nil, otherwise the environment and ~/.docker/config.json (including credHelpers and credsStore), so a prior `docker login <mirror-host>` is honored.
Types ¶
type Credentials ¶ added in v1.2.7
Credentials resolves registry credentials for a registry host, returning the username and secret to authenticate with. An empty username and secret with a nil error means no credentials are available and the caller should attempt anonymous access.
It is an alias rather than a defined type so that callers can pass their own named function type (e.g. inference.RegistryCredentials) without a conversion.
type ManifestNotFoundError ¶
type ManifestNotFoundError struct {
// contains filtered or unexported fields
}
func (*ManifestNotFoundError) Error ¶
func (r *ManifestNotFoundError) Error() string