Documentation ¶
Index ¶
- Variables
- func GetAdditionalTags(images []string) ([]reference.NamedTagged, error)
- func GetSystemContext(signaturePolicyPath, authFilePath string, forceCompress bool) *types.SystemContext
- func ReposToMap(repotags []string) map[string][]string
- type DockerRegistryOptions
- type Filter
- type Image
- func (i *Image) Annotations(ctx context.Context) (map[string]string, error)
- func (i *Image) Comment(ctx context.Context, manifestType string) (string, error)
- func (i *Image) Containers() ([]string, error)
- func (i *Image) Created() time.Time
- func (i *Image) Dangling() bool
- func (i *Image) Decompose() error
- func (i *Image) Digest() digest.Digest
- func (i *Image) DriverData() (*inspect.Data, error)
- func (i *Image) History(ctx context.Context) ([]ociv1.History, []types.BlobInfo, error)
- func (i *Image) ID() string
- func (i *Image) InputIsID() bool
- func (i *Image) Inspect(ctx context.Context) (*inspect.ImageData, error)
- func (i *Image) Labels(ctx context.Context) (map[string]string, error)
- func (i *Image) Layer() (*storage.Layer, error)
- func (i *Image) Manifest(ctx context.Context) ([]byte, string, error)
- func (i *Image) MatchRepoTag(input string) (string, error)
- func (i *Image) MatchesID(id string) bool
- func (i *Image) Names() []string
- func (i *Image) PushImage(ctx context.Context, ...) error
- func (i *Image) Remove(force bool) error
- func (i *Image) RepoDigests() []string
- func (i *Image) Size(ctx context.Context) (*uint64, error)
- func (i *Image) TagImage(tag string) error
- func (i *Image) ToImageRef(ctx context.Context) (types.Image, error)
- func (i *Image) TopLayer() string
- func (i *Image) UntagImage(tag string) error
- type ResultFilter
- type Runtime
- func (ir *Runtime) GetImages() ([]*Image, error)
- func (ir *Runtime) Import(ctx context.Context, path, reference string, writer io.Writer, ...) (*Image, error)
- func (ir *Runtime) LoadFromArchive(ctx context.Context, name, signaturePolicyPath string, writer io.Writer) ([]*Image, error)
- func (ir *Runtime) New(ctx context.Context, name, signaturePolicyPath, authfile string, ...) (*Image, error)
- func (ir *Runtime) NewFromLocal(name string) (*Image, error)
- func (ir *Runtime) Shutdown(force bool) error
- type SigningOptions
Constants ¶
This section is empty.
Variables ¶
var ( // DockerArchive is the transport we prepend to an image name // when saving to docker-archive DockerArchive = dockerarchive.Transport.Name() // OCIArchive is the transport we prepend to an image name // when saving to oci-archive OCIArchive = ociarchive.Transport.Name() // DirTransport is the transport for pushing and pulling // images to and from a directory DirTransport = directory.Transport.Name() // TransportNames are the supported transports in string form TransportNames = [...]string{DefaultTransport, DockerArchive, OCIArchive, "ostree:", "dir:"} // TarballTransport is the transport for importing a tar archive // and creating a filesystem image TarballTransport = tarball.Transport.Name() // DockerTransport is the transport for docker registries DockerTransport = docker.Transport.Name() + "://" // AtomicTransport is the transport for atomic registries AtomicTransport = "atomic" // DefaultTransport is a prefix that we apply to an image name DefaultTransport = DockerTransport )
Functions ¶
func GetAdditionalTags ¶ added in v0.5.4
func GetAdditionalTags(images []string) ([]reference.NamedTagged, error)
GetAdditionalTags returns a list of reference.NamedTagged for the additional tags given in images
func GetSystemContext ¶ added in v0.3.3
func GetSystemContext(signaturePolicyPath, authFilePath string, forceCompress bool) *types.SystemContext
GetSystemContext Constructs a new containers/image/types.SystemContext{} struct from the given signaturePolicy path
func ReposToMap ¶ added in v0.3.4
ReposToMap parses the specified repotags and returns a map with repositories as keys and the corresponding arrays of tags as values.
Types ¶
type DockerRegistryOptions ¶ added in v0.3.3
type DockerRegistryOptions struct { // DockerRegistryCreds is the user name and password to supply in case // we need to pull an image from a registry, and it requires us to // authenticate. DockerRegistryCreds *types.DockerAuthConfig // DockerCertPath is the location of a directory containing CA // certificates which will be used to verify the registry's certificate // (all files with names ending in ".crt"), and possibly client // certificates and private keys (pairs of files with the same name, // except for ".cert" and ".key" suffixes). DockerCertPath string // DockerInsecureSkipTLSVerify turns off verification of TLS // certificates and allows connecting to registries without encryption. DockerInsecureSkipTLSVerify bool }
DockerRegistryOptions encapsulates settings that affect how we connect or authenticate to a remote registry.
func (DockerRegistryOptions) GetSystemContext ¶ added in v0.3.3
func (o DockerRegistryOptions) GetSystemContext(signaturePolicyPath, authFile string, forceCompress bool, additionalDockerArchiveTags []reference.NamedTagged) *types.SystemContext
GetSystemContext constructs a new system context from the given signaturePolicy path and the values in the DockerRegistryOptions
type Filter ¶ added in v0.3.4
Filter is a function to determine whether an image is included in command output. Images to be outputted are tested using the function. A true return will include the image, a false return will exclude it.
type Image ¶
type Image struct { inspect.ImageData inspect.ImageResult InputName string Local bool // contains filtered or unexported fields }
Image is the primary struct for dealing with images It is still very much a work in progress
func FilterImages ¶ added in v0.3.4
func FilterImages(images []*Image, filters []ResultFilter) []*Image
FilterImages filters images using a set of predefined filter funcs
func (*Image) Annotations ¶ added in v0.3.4
Annotations returns the annotations of an image
func (*Image) Comment ¶ added in v0.4.4
Comment returns the Comment for an image depending on its ManifestType
func (*Image) Containers ¶ added in v0.4.4
Containers a list of container IDs associated with the image
func (*Image) Digest ¶ added in v0.3.3
func (i *Image) Digest() digest.Digest
Digest returns the image's digest
func (*Image) DriverData ¶ added in v0.3.4
DriverData gets the driver data from the store on a layer
func (*Image) History ¶ added in v0.3.4
History gets the history of an image and information about its layers
func (*Image) InputIsID ¶ added in v0.3.4
InputIsID returns a bool if the user input for an image is the image's partial or full id
func (*Image) Manifest ¶ added in v0.3.4
Manifest returns the image's manifest as a byte array and manifest type as a string. The manifest type is MediaTypeImageManifest from ociv1.
func (*Image) MatchRepoTag ¶ added in v0.3.4
MatchRepoTag takes a string and tries to match it against an image's repotags
func (*Image) MatchesID ¶ added in v0.3.3
MatchesID returns a bool based on if the input id matches the image's id
func (*Image) Names ¶ added in v0.3.3
Names returns a string array of names associated with the image
func (*Image) PushImage ¶ added in v0.3.3
func (i *Image) PushImage(ctx context.Context, destination, manifestMIMEType, authFile, signaturePolicyPath string, writer io.Writer, forceCompress bool, signingOptions SigningOptions, dockerRegistryOptions *DockerRegistryOptions, forceSecure bool, additionalDockerArchiveTags []reference.NamedTagged) error
PushImage pushes the given image to a location described by the given path
func (*Image) Remove ¶
Remove an image; container removal for the image must be done outside the context of images
func (*Image) RepoDigests ¶ added in v0.4.4
RepoDigests returns a string array of repodigests associated with the image
func (*Image) ToImageRef ¶ added in v0.3.4
ToImageRef returns an image reference type from an image TODO: Hopefully we can remove this exported function for mheon
func (*Image) UntagImage ¶ added in v0.3.4
UntagImage removes a tag from the given image
type ResultFilter ¶ added in v0.3.4
ResultFilter is a mock function for image filtering
func CreatedAfterFilter ¶ added in v0.3.4
func CreatedAfterFilter(createTime time.Time) ResultFilter
CreatedAfterFilter allows you to filter on images created after the given time.Time
func CreatedBeforeFilter ¶ added in v0.3.4
func CreatedBeforeFilter(createTime time.Time) ResultFilter
CreatedBeforeFilter allows you to filter on images created before the given time.Time
func DanglingFilter ¶ added in v0.3.4
func DanglingFilter() ResultFilter
DanglingFilter allows you to filter images for dangling images
func LabelFilter ¶ added in v0.3.4
func LabelFilter(ctx context.Context, labelfilter string) ResultFilter
LabelFilter allows you to filter by images labels key and/or value
func OutputImageFilter ¶ added in v0.3.4
func OutputImageFilter(userImage *Image) ResultFilter
OutputImageFilter allows you to filter by an a specific image name
type Runtime ¶ added in v0.3.3
type Runtime struct { SignaturePolicyPath string // contains filtered or unexported fields }
Runtime contains the store
func NewImageRuntimeFromOptions ¶ added in v0.3.4
func NewImageRuntimeFromOptions(options storage.StoreOptions) (*Runtime, error)
NewImageRuntimeFromOptions creates an Image Runtime including the store given store options
func NewImageRuntimeFromStore ¶ added in v0.3.4
NewImageRuntimeFromStore creates an ImageRuntime based on a provided store
func (*Runtime) Import ¶ added in v0.3.4
func (ir *Runtime) Import(ctx context.Context, path, reference string, writer io.Writer, signingOptions SigningOptions, imageConfig ociv1.Image) (*Image, error)
Import imports and image into the store and returns an image
func (*Runtime) LoadFromArchive ¶ added in v0.5.4
func (ir *Runtime) LoadFromArchive(ctx context.Context, name, signaturePolicyPath string, writer io.Writer) ([]*Image, error)
LoadFromArchive creates a new image object for images pulled from a tar archive (podman load) This function is needed because it is possible for a tar archive to have multiple tags for one image
func (*Runtime) New ¶ added in v0.3.3
func (ir *Runtime) New(ctx context.Context, name, signaturePolicyPath, authfile string, writer io.Writer, dockeroptions *DockerRegistryOptions, signingoptions SigningOptions, forcePull, forceSecure bool) (*Image, error)
New creates a new image object where the image could be local or remote
func (*Runtime) NewFromLocal ¶ added in v0.3.3
NewFromLocal creates a new image object that is intended to only deal with local images already in the store (or its aliases)
type SigningOptions ¶ added in v0.3.3
type SigningOptions struct { // RemoveSignatures directs us to remove any signatures which are already present. RemoveSignatures bool // SignBy is a key identifier of some kind, indicating that a signature should be generated using the specified private key and stored with the image. SignBy string }
SigningOptions encapsulates settings that control whether or not we strip or add signatures to images when writing them.