Documentation
¶
Overview ¶
Package source resolves image references to the platform images to scan, pulling directly from the registry without a Docker daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNoPlatform = errors.New("no matching platform")
ErrNoPlatform is returned when the filter matches no platform of an image.
Functions ¶
Types ¶
type Image ¶
type Image struct {
// Ref is the reference, or for a local input the name of the image in
// it (the input path if it names none).
Ref string
// Input is the path of a local layout or archive, empty for a registry.
Input string
// Digest of the manifest or index the reference points to.
Digest string
Platforms []PlatformImage
// contains filtered or unexported fields
}
Image is a resolved image reference.
type Mirror ¶
Mirror serves the images of Registry under Prefix, e.g. a Harbor proxy cache project for Docker Hub: docker.io=harbor.example.com/dockerhub pulls docker.io/library/nginx from harbor.example.com/dockerhub/library/nginx. A mirror is trusted for tags; digests are verified.
func ParseMirror ¶
ParseMirror parses "registry=host[/path]".
type Options ¶
type Options struct {
Platforms PlatformFilter
Keychain authn.Keychain
// Insecure allows plain HTTP registries (for tests and local registries).
Insecure bool
// Mirrors are tried in order before the registry itself, which is the
// fallback if all fail (as containerd does).
Mirrors []Mirror
// Logger notes failed mirrors; nil for none.
Logger *slog.Logger
// Input reads the image from a local OCI image layout or docker save
// archive instead of a registry; the reference then names the image in
// it, empty for the only one. Close the Image when done.
Input string
}
Options configure Fetch.
type PlatformFilter ¶
type PlatformFilter struct {
// contains filtered or unexported fields
}
PlatformFilter selects the platforms of a multi-arch image. The zero value selects all platforms.
func ParsePlatforms ¶
func ParsePlatforms(s string) (PlatformFilter, error)
ParsePlatforms parses "all", "host" or a comma-separated list such as "linux/amd64,linux/arm64".
func (PlatformFilter) Match ¶
func (f PlatformFilter) Match(p v1.Platform) bool
Match reports whether p is selected.
func (PlatformFilter) String ¶
func (f PlatformFilter) String() string