images

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 31 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(ctx context.Context, containerFiles []string, options entities.BuildOptions) (*entities.BuildReport, error)

Build creates an image using a containerfile reference

func Diff

func Diff(ctx context.Context, nameOrID string, options *DiffOptions) ([]archive.Change, error)

Diff provides the changes between two container layers

func Exists

func Exists(ctx context.Context, nameOrID string, options *ExistsOptions) (bool, error)

Exists a lightweight way to determine if an image exists in local storage. It returns a boolean response.

func Export

func Export(ctx context.Context, nameOrIDs []string, w io.Writer, options *ExportOptions) error

Export saves images from local storage as a tarball or image archive. The optional format parameter is used to change the format of the output.

func GetImage

func GetImage(ctx context.Context, nameOrID string, options *GetOptions) (*entities.ImageInspectReport, error)

Get performs an image inspect. To have the on-disk size of the image calculated, you can use the optional size parameter.

func History

func History(ctx context.Context, nameOrID string, options *HistoryOptions) ([]*types.HistoryResponse, error)

History returns the parent layers of an image.

func Import

Imports adds the given image to the local image store. This can be done by file and the given reader or via the url parameter. Additional metadata can be associated with the image by using the changes and message parameters. The image can also be tagged given a reference. One of url OR r must be provided.

func List

func List(ctx context.Context, options *ListOptions) ([]*entities.ImageSummary, error)

List returns a list of images in local storage. The all boolean and filters parameters are optional ways to alter the image query.

func Prune

func Prune(ctx context.Context, options *PruneOptions) ([]*reports.PruneReport, error)

Prune removes unused images from local storage. The optional filters can be used to further define which images should be pruned.

func Pull

func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string, error)

Pull is the binding for libpod's v2 endpoints for pulling images. Note that `rawImage` must be a reference to a registry (i.e., of docker transport or be normalized to one). Other transports are rejected as they do not make sense in a remote context. Progress reported on stderr

func Push

func Push(ctx context.Context, source string, destination string, options *PushOptions) error

Push is the binding for libpod's v2 endpoints for push images. Note that `source` must be a referring to an image in the remote's container storage. The destination must be a reference to a registry (i.e., of docker transport or be normalized to one). Other transports are rejected as they do not make sense in a remote context.

func Remove

func Remove(ctx context.Context, images []string, options *RemoveOptions) (*entities.ImageRemoveReport, []error)

Remove removes one or more images from the local storage. Use optional force option to remove an image, even if it's used by containers.

func Search(ctx context.Context, term string, options *SearchOptions) ([]entities.ImageSearchReport, error)

Search is the binding for libpod's v2 endpoints for Search images.

func Tag

func Tag(ctx context.Context, nameOrID, tag, repo string, options *TagOptions) error

Tag adds an additional name to locally-stored image. Both the tag and repo parameters are required.

func Tree

func Tree(ctx context.Context, nameOrID string, options *TreeOptions) (*entities.ImageTreeReport, error)

Tree retrieves a "tree" based representation of the given image

func Untag

func Untag(ctx context.Context, nameOrID, tag, repo string, options *UntagOptions) error

Untag removes a name from locally-stored image. Both the tag and repo parameters are required.

Types

type BuildOptions

type BuildOptions struct {
	buildahDefine.BuildOptions
}

BuildOptions are optional options for building images

type DiffOptions

type DiffOptions struct {
}

DiffOptions are optional options image diffs

func (*DiffOptions) Changed

func (o *DiffOptions) Changed(fieldName string) bool

Changed

func (*DiffOptions) ToParams

func (o *DiffOptions) ToParams() (url.Values, error)

ToParams

type ExistsOptions

type ExistsOptions struct {
}

ExistsOptions are optional options for checking if an image exists

func (*ExistsOptions) Changed

func (o *ExistsOptions) Changed(fieldName string) bool

Changed

func (*ExistsOptions) ToParams

func (o *ExistsOptions) ToParams() (url.Values, error)

ToParams

type ExportOptions

type ExportOptions struct {
	// Compress the image
	Compress *bool
	// Format of the output
	Format *string
}

ExportOptions are optional options for exporting images

func (*ExportOptions) Changed

func (o *ExportOptions) Changed(fieldName string) bool

Changed

func (*ExportOptions) GetCompress

func (o *ExportOptions) GetCompress() bool

GetCompress

func (*ExportOptions) GetFormat

func (o *ExportOptions) GetFormat() string

GetFormat

func (*ExportOptions) ToParams

func (o *ExportOptions) ToParams() (url.Values, error)

ToParams

func (*ExportOptions) WithCompress

func (o *ExportOptions) WithCompress(value bool) *ExportOptions

WithCompress

func (*ExportOptions) WithFormat

func (o *ExportOptions) WithFormat(value string) *ExportOptions

WithFormat

type GetOptions

type GetOptions struct {
	// Size computes the amount of storage the image consumes
	Size *bool
}

GetOptions are optional options for inspecting an image

func (*GetOptions) Changed

func (o *GetOptions) Changed(fieldName string) bool

Changed

func (*GetOptions) GetSize

func (o *GetOptions) GetSize() bool

GetSize

func (*GetOptions) ToParams

func (o *GetOptions) ToParams() (url.Values, error)

ToParams

func (*GetOptions) WithSize

func (o *GetOptions) WithSize(value bool) *GetOptions

WithSize

type HistoryOptions

type HistoryOptions struct {
}

HistoryOptions are optional options image history

func (*HistoryOptions) Changed

func (o *HistoryOptions) Changed(fieldName string) bool

Changed

func (*HistoryOptions) ToParams

func (o *HistoryOptions) ToParams() (url.Values, error)

ToParams

type ImportOptions

type ImportOptions struct {
	// Changes to be applied to the image
	Changes *[]string
	// Message to be applied to the image
	Message *string
	// Reference is a tag to be applied to the image
	Reference *string
	// Url to option image to import. Cannot be used with the reader
	URL *string
}

ImportOptions are optional options for importing images

func (*ImportOptions) Changed

func (o *ImportOptions) Changed(fieldName string) bool

Changed

func (*ImportOptions) GetChanges

func (o *ImportOptions) GetChanges() []string

GetChanges

func (*ImportOptions) GetMessage

func (o *ImportOptions) GetMessage() string

GetMessage

func (*ImportOptions) GetReference

func (o *ImportOptions) GetReference() string

GetReference

func (*ImportOptions) GetURL

func (o *ImportOptions) GetURL() string

GetURL

func (*ImportOptions) ToParams

func (o *ImportOptions) ToParams() (url.Values, error)

ToParams

func (*ImportOptions) WithChanges

func (o *ImportOptions) WithChanges(value []string) *ImportOptions

WithChanges

func (*ImportOptions) WithMessage

func (o *ImportOptions) WithMessage(value string) *ImportOptions

WithMessage

func (*ImportOptions) WithReference

func (o *ImportOptions) WithReference(value string) *ImportOptions

WithReference

func (*ImportOptions) WithURL

func (o *ImportOptions) WithURL(value string) *ImportOptions

WithURL

type ListOptions

type ListOptions struct {
	// All lists all image in the image store including dangling images
	All *bool
	// filters that can be used to get a more specific list of images
	Filters map[string][]string
}

ListOptions are optional options for listing images

func (*ListOptions) Changed

func (o *ListOptions) Changed(fieldName string) bool

Changed

func (*ListOptions) GetAll

func (o *ListOptions) GetAll() bool

GetAll

func (*ListOptions) GetFilters

func (o *ListOptions) GetFilters() map[string][]string

GetFilters

func (*ListOptions) ToParams

func (o *ListOptions) ToParams() (url.Values, error)

ToParams

func (*ListOptions) WithAll

func (o *ListOptions) WithAll(value bool) *ListOptions

WithAll

func (*ListOptions) WithFilters

func (o *ListOptions) WithFilters(value map[string][]string) *ListOptions

WithFilters

type LoadOptions

type LoadOptions struct {
	// Reference is the name of the loaded image
	Reference *string
}

LoadOptions are optional options for loading an image

func (*LoadOptions) Changed

func (o *LoadOptions) Changed(fieldName string) bool

Changed

func (*LoadOptions) GetReference

func (o *LoadOptions) GetReference() string

GetReference

func (*LoadOptions) ToParams

func (o *LoadOptions) ToParams() (url.Values, error)

ToParams

func (*LoadOptions) WithReference

func (o *LoadOptions) WithReference(value string) *LoadOptions

WithReference

type PruneOptions

type PruneOptions struct {
	// Prune all images
	All *bool
	// Filters to apply when pruning images
	Filters map[string][]string
}

PruneOptions are optional options for pruning images

func (*PruneOptions) Changed

func (o *PruneOptions) Changed(fieldName string) bool

Changed

func (*PruneOptions) GetAll

func (o *PruneOptions) GetAll() bool

GetAll

func (*PruneOptions) GetFilters

func (o *PruneOptions) GetFilters() map[string][]string

GetFilters

func (*PruneOptions) ToParams

func (o *PruneOptions) ToParams() (url.Values, error)

ToParams

func (*PruneOptions) WithAll

func (o *PruneOptions) WithAll(value bool) *PruneOptions

WithAll

func (*PruneOptions) WithFilters

func (o *PruneOptions) WithFilters(value map[string][]string) *PruneOptions

WithFilters

type PullOptions

type PullOptions struct {
	// AllTags can be specified to pull all tags of an image. Note
	// that this only works if the image does not include a tag.
	AllTags *bool
	// Arch will overwrite the local architecture for image pulls.
	Arch *string
	// Authfile is the path to the authentication file. Ignored for remote
	// calls.
	Authfile *string
	// OS will overwrite the local operating system (OS) for image
	// pulls.
	OS *string
	// Password for authenticating against the registry.
	Password *string
	// Quiet can be specified to suppress pull progress when pulling.  Ignored
	// for remote calls.
	Quiet *bool
	// SkipTLSVerify to skip HTTPS and certificate verification.
	SkipTLSVerify *bool
	// Username for authenticating against the registry.
	Username *string
	// Variant will overwrite the local variant for image pulls.
	Variant *string
}

PullOptions are optional options for pulling images

func (*PullOptions) Changed

func (o *PullOptions) Changed(fieldName string) bool

Changed

func (*PullOptions) GetAllTags

func (o *PullOptions) GetAllTags() bool

GetAllTags

func (*PullOptions) GetArch

func (o *PullOptions) GetArch() string

GetArch

func (*PullOptions) GetAuthfile

func (o *PullOptions) GetAuthfile() string

GetAuthfile

func (*PullOptions) GetOS

func (o *PullOptions) GetOS() string

GetOS

func (*PullOptions) GetPassword

func (o *PullOptions) GetPassword() string

GetPassword

func (*PullOptions) GetQuiet

func (o *PullOptions) GetQuiet() bool

GetQuiet

func (*PullOptions) GetSkipTLSVerify

func (o *PullOptions) GetSkipTLSVerify() bool

GetSkipTLSVerify

func (*PullOptions) GetUsername

func (o *PullOptions) GetUsername() string

GetUsername

func (*PullOptions) GetVariant

func (o *PullOptions) GetVariant() string

GetVariant

func (*PullOptions) ToParams

func (o *PullOptions) ToParams() (url.Values, error)

ToParams

func (*PullOptions) WithAllTags

func (o *PullOptions) WithAllTags(value bool) *PullOptions

WithAllTags

func (*PullOptions) WithArch

func (o *PullOptions) WithArch(value string) *PullOptions

WithArch

func (*PullOptions) WithAuthfile

func (o *PullOptions) WithAuthfile(value string) *PullOptions

WithAuthfile

func (*PullOptions) WithOS

func (o *PullOptions) WithOS(value string) *PullOptions

WithOS

func (*PullOptions) WithPassword

func (o *PullOptions) WithPassword(value string) *PullOptions

WithPassword

func (*PullOptions) WithQuiet

func (o *PullOptions) WithQuiet(value bool) *PullOptions

WithQuiet

func (*PullOptions) WithSkipTLSVerify

func (o *PullOptions) WithSkipTLSVerify(value bool) *PullOptions

WithSkipTLSVerify

func (*PullOptions) WithUsername

func (o *PullOptions) WithUsername(value string) *PullOptions

WithUsername

func (*PullOptions) WithVariant

func (o *PullOptions) WithVariant(value string) *PullOptions

WithVariant

type PushOptions

type PushOptions struct {
	// All indicates whether to push all images related to the image list
	All *bool
	// Authfile is the path to the authentication file. Ignored for remote
	// calls.
	Authfile *string
	// Compress tarball image layers when pushing to a directory using the 'dir' transport.
	Compress *bool
	// Manifest type of the pushed image
	Format *string
	// Password for authenticating against the registry.
	Password *string
	// SkipTLSVerify to skip HTTPS and certificate verification.
	SkipTLSVerify *bool
	// Username for authenticating against the registry.
	Username *string
}

PushOptions are optional options for importing images

func (*PushOptions) Changed

func (o *PushOptions) Changed(fieldName string) bool

Changed

func (*PushOptions) GetAll

func (o *PushOptions) GetAll() bool

GetAll

func (*PushOptions) GetAuthfile

func (o *PushOptions) GetAuthfile() string

GetAuthfile

func (*PushOptions) GetCompress

func (o *PushOptions) GetCompress() bool

GetCompress

func (*PushOptions) GetFormat added in v3.1.0

func (o *PushOptions) GetFormat() string

GetFormat

func (*PushOptions) GetPassword

func (o *PushOptions) GetPassword() string

GetPassword

func (*PushOptions) GetSkipTLSVerify

func (o *PushOptions) GetSkipTLSVerify() bool

GetSkipTLSVerify

func (*PushOptions) GetUsername

func (o *PushOptions) GetUsername() string

GetUsername

func (*PushOptions) ToParams

func (o *PushOptions) ToParams() (url.Values, error)

ToParams

func (*PushOptions) WithAll

func (o *PushOptions) WithAll(value bool) *PushOptions

WithAll

func (*PushOptions) WithAuthfile

func (o *PushOptions) WithAuthfile(value string) *PushOptions

WithAuthfile

func (*PushOptions) WithCompress

func (o *PushOptions) WithCompress(value bool) *PushOptions

WithCompress

func (*PushOptions) WithFormat added in v3.1.0

func (o *PushOptions) WithFormat(value string) *PushOptions

WithFormat

func (*PushOptions) WithPassword

func (o *PushOptions) WithPassword(value string) *PushOptions

WithPassword

func (*PushOptions) WithSkipTLSVerify

func (o *PushOptions) WithSkipTLSVerify(value bool) *PushOptions

WithSkipTLSVerify

func (*PushOptions) WithUsername

func (o *PushOptions) WithUsername(value string) *PushOptions

WithUsername

type RemoveOptions

type RemoveOptions struct {
	// All removes all images
	All *bool
	// Forces removes all containers based on the image
	Force *bool
}

RemoveOptions are optional options for image removal

func (*RemoveOptions) Changed

func (o *RemoveOptions) Changed(fieldName string) bool

Changed

func (*RemoveOptions) GetAll

func (o *RemoveOptions) GetAll() bool

GetAll

func (*RemoveOptions) GetForce

func (o *RemoveOptions) GetForce() bool

GetForce

func (*RemoveOptions) ToParams

func (o *RemoveOptions) ToParams() (url.Values, error)

ToParams

func (*RemoveOptions) WithAll

func (o *RemoveOptions) WithAll(value bool) *RemoveOptions

WithAll

func (*RemoveOptions) WithForce

func (o *RemoveOptions) WithForce(value bool) *RemoveOptions

WithForce

type SearchOptions

type SearchOptions struct {
	// Authfile is the path to the authentication file. Ignored for remote
	// calls.
	Authfile *string
	// Filters for the search results.
	Filters map[string][]string
	// Limit the number of results.
	Limit *int
	// NoTrunc will not truncate the output.
	NoTrunc *bool
	// SkipTLSVerify to skip  HTTPS and certificate verification.
	SkipTLSVerify *bool
	// ListTags search the available tags of the repository
	ListTags *bool
}

SearchOptions are optional options for searching images on registries

func (*SearchOptions) Changed

func (o *SearchOptions) Changed(fieldName string) bool

Changed

func (*SearchOptions) GetAuthfile

func (o *SearchOptions) GetAuthfile() string

GetAuthfile

func (*SearchOptions) GetFilters

func (o *SearchOptions) GetFilters() map[string][]string

GetFilters

func (*SearchOptions) GetLimit

func (o *SearchOptions) GetLimit() int

GetLimit

func (*SearchOptions) GetListTags

func (o *SearchOptions) GetListTags() bool

GetListTags

func (*SearchOptions) GetNoTrunc

func (o *SearchOptions) GetNoTrunc() bool

GetNoTrunc

func (*SearchOptions) GetSkipTLSVerify

func (o *SearchOptions) GetSkipTLSVerify() bool

GetSkipTLSVerify

func (*SearchOptions) ToParams

func (o *SearchOptions) ToParams() (url.Values, error)

ToParams

func (*SearchOptions) WithAuthfile

func (o *SearchOptions) WithAuthfile(value string) *SearchOptions

WithAuthfile

func (*SearchOptions) WithFilters

func (o *SearchOptions) WithFilters(value map[string][]string) *SearchOptions

WithFilters

func (*SearchOptions) WithLimit

func (o *SearchOptions) WithLimit(value int) *SearchOptions

WithLimit

func (*SearchOptions) WithListTags

func (o *SearchOptions) WithListTags(value bool) *SearchOptions

WithListTags

func (*SearchOptions) WithNoTrunc

func (o *SearchOptions) WithNoTrunc(value bool) *SearchOptions

WithNoTrunc

func (*SearchOptions) WithSkipTLSVerify

func (o *SearchOptions) WithSkipTLSVerify(value bool) *SearchOptions

WithSkipTLSVerify

type TagOptions

type TagOptions struct {
}

TagOptions are optional options for tagging images

func (*TagOptions) Changed

func (o *TagOptions) Changed(fieldName string) bool

Changed

func (*TagOptions) ToParams

func (o *TagOptions) ToParams() (url.Values, error)

ToParams

type TreeOptions

type TreeOptions struct {
	// WhatRequires ...
	WhatRequires *bool
}

TreeOptions are optional options for a tree-based representation of the image

func (*TreeOptions) Changed

func (o *TreeOptions) Changed(fieldName string) bool

Changed

func (*TreeOptions) GetWhatRequires

func (o *TreeOptions) GetWhatRequires() bool

GetWhatRequires

func (*TreeOptions) ToParams

func (o *TreeOptions) ToParams() (url.Values, error)

ToParams

func (*TreeOptions) WithWhatRequires

func (o *TreeOptions) WithWhatRequires(value bool) *TreeOptions

WithWhatRequires

type UntagOptions

type UntagOptions struct {
}

UntagOptions are optional options for untagging images

func (*UntagOptions) Changed

func (o *UntagOptions) Changed(fieldName string) bool

Changed

func (*UntagOptions) ToParams

func (o *UntagOptions) ToParams() (url.Values, error)

ToParams

Jump to

Keyboard shortcuts

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