Documentation
¶
Overview ¶
Package image provides container image storage and management.
Index ¶
- type Config
- type FlexString
- type HealthCheckConfig
- type History
- type ImageConfig
- type ImageRecord
- type RootFS
- type SearchResult
- type Store
- func (s *Store) Config(idOrTag string) (*Config, error)
- func (s *Store) Exists(idOrTag string) bool
- func (s *Store) Export(idOrTag string, writer io.Writer) error
- func (s *Store) Get(idOrTag string) (*ImageRecord, error)
- func (s *Store) GetLayerPath(digest string) string
- func (s *Store) GetLayerPaths(idOrTag string) ([]string, error)
- func (s *Store) History(idOrTag string) ([]History, error)
- func (s *Store) Import(reader io.Reader) (*ImageRecord, error)
- func (s *Store) Inspect(idOrTag string) (*Config, error)
- func (s *Store) List() ([]common.ImageInfo, error)
- func (s *Store) Prune() ([]string, error)
- func (s *Store) Pull(imageRef string) (*ImageRecord, error)
- func (s *Store) Push(idOrTag string) error
- func (s *Store) Remove(idOrTag string) error
- func (s *Store) SaveRecord(record *ImageRecord) error
- func (s *Store) Search(term string, limit int) ([]SearchResult, error)
- func (s *Store) SetRegistryAuth(username, password string)
- func (s *Store) StartGC(ctx context.Context, interval time.Duration, maxAge time.Duration)
- func (s *Store) Tag(source, target string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Created FlexString `json:"created,omitempty"`
Author string `json:"author,omitempty"`
Architecture string `json:"architecture"`
OS string `json:"os"`
Config ImageConfig `json:"config"`
RootFS RootFS `json:"rootfs"`
History []History `json:"history,omitempty"`
}
Config represents an OCI image configuration.
type FlexString ¶ added in v0.9.3
type FlexString string
FlexString is a string that can be unmarshaled from either a JSON string or an int64 (unix timestamp). Docker image configs use RFC3339 strings, while OCI image configs may use int64 unix timestamps.
func (*FlexString) UnmarshalJSON ¶ added in v0.9.3
func (fs *FlexString) UnmarshalJSON(data []byte) error
type HealthCheckConfig ¶
type HealthCheckConfig struct {
Test []string `json:"Test,omitempty"`
Interval int64 `json:"Interval,omitempty"`
Timeout int64 `json:"Timeout,omitempty"`
Retries int `json:"Retries,omitempty"`
StartPeriod int64 `json:"StartPeriod,omitempty"`
}
HealthCheckConfig describes a container's health check.
type History ¶
type History struct {
ID string `json:"Id,omitempty"`
Created FlexString `json:"created,omitempty"`
CreatedBy string `json:"created_by,omitempty"`
Size int64 `json:"Size,omitempty"`
Comment string `json:"comment,omitempty"`
EmptyLayer bool `json:"empty_layer,omitempty"`
}
History describes the history of an image layer.
type ImageConfig ¶
type ImageConfig struct {
User string `json:"User,omitempty"`
ExposedPorts map[string]struct{} `json:"ExposedPorts,omitempty"`
Env []string `json:"Env,omitempty"`
Entrypoint []string `json:"Entrypoint,omitempty"`
Cmd []string `json:"Cmd,omitempty"`
Volumes map[string]struct{} `json:"Volumes,omitempty"`
WorkingDir string `json:"WorkingDir,omitempty"`
Labels map[string]string `json:"Labels,omitempty"`
StopSignal string `json:"StopSignal,omitempty"`
Shell []string `json:"Shell,omitempty"`
HealthCheck *HealthCheckConfig `json:"Healthcheck,omitempty"`
}
ImageConfig is the runtime configuration for a container.
type ImageRecord ¶
type ImageRecord struct {
ID string `json:"id"`
RepoTags []string `json:"repo_tags"`
RepoDigests []string `json:"repo_digests"`
Parent string `json:"parent,omitempty"`
Config *Config `json:"config"`
Manifest *registry.ManifestV2 `json:"manifest,omitempty"`
Size int64 `json:"size"`
Created int64 `json:"created"`
Architecture string `json:"architecture"`
OS string `json:"os"`
Layers []string `json:"layers"`
}
ImageRecord stores image metadata on disk.
type SearchResult ¶
type SearchResult struct {
Name string `json:"repo_name"`
Description string `json:"short_description"`
StarCount int `json:"star_count"`
IsOfficial bool `json:"is_official"`
IsAutomated bool `json:"is_automated"`
}
SearchResult represents a Docker Hub search result.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages OCI images on disk.
func (*Store) Get ¶
func (s *Store) Get(idOrTag string) (*ImageRecord, error)
Get returns an image record by ID or tag.
func (*Store) GetLayerPath ¶
GetLayerPath returns the path to a layer blob on disk.
func (*Store) GetLayerPaths ¶
GetLayerPaths returns paths to all layer tarballs for an image.
func (*Store) Import ¶
func (s *Store) Import(reader io.Reader) (*ImageRecord, error)
Import imports an image from a Docker-format save tar.
func (*Store) Pull ¶
func (s *Store) Pull(imageRef string) (*ImageRecord, error)
Pull downloads an image from a registry.
func (*Store) SaveRecord ¶
func (s *Store) SaveRecord(record *ImageRecord) error
func (*Store) Search ¶
func (s *Store) Search(term string, limit int) ([]SearchResult, error)
Search searches Docker Hub for images.