container

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCopyName      = errors.New("invalid copy name (format: <file>[:<destination>])")
	ErrorInvalidLabelFormat = errors.New("invalid label (format: <key>=<value>)")
)

Functions

This section is empty.

Types

type Binary

type Binary struct {
	Platform ocischemav1.Platform
	File     string
}

type Blob

type Blob struct {
	Sha256 digest.Digest
	Data   []byte
}

type Container

type Container struct {
	Blobs         []Blob
	Shared        []ocischemav1.Descriptor
	SharedDiffIDs []digest.Digest
	Layout        ocischemav1.ImageLayout
	Index         ocischemav1.Index
	Labels        map[string]string
	Healthcheck   *HealthcheckConfig
}

func New

func New() (*Container, error)

func (*Container) AddBinary

func (c *Container) AddBinary(fnames []string) error

func (*Container) Copy

func (c *Container) Copy(names ...string) error

func (*Container) Save

func (c *Container) Save(dirname string) error

func (*Container) SetHealthcheck added in v1.0.4

func (c *Container) SetHealthcheck(cmd []string, interval, timeout, start *time.Duration, retries int) error

func (*Container) SetHealthcheckFromArg added in v1.0.4

func (c *Container) SetHealthcheckFromArg(arg string) error

func (*Container) SetLabels

func (c *Container) SetLabels(labels ...string) error

func (*Container) WriteBlobs

func (c *Container) WriteBlobs(dirname string) error

func (*Container) WriteIndex

func (c *Container) WriteIndex(dirname string) error

func (*Container) WriteLayout

func (c *Container) WriteLayout(dirname string) error

type HealthcheckConfig added in v1.0.4

type HealthcheckConfig struct {
	Test        []string       `json:"Test"`
	Interval    *time.Duration `json:"Interval,omitempty"`
	Timeout     *time.Duration `json:"Timeout,omitempty"`
	StartPeriod *time.Duration `json:"StartPeriod,omitempty"`
	Retries     int            `json:"Retries,omitempty"`
}

type Image added in v1.0.4

type Image struct {
	Created      *time.Time            `json:"created,omitempty"`
	Author       string                `json:"author,omitempty"`
	Architecture string                `json:"architecture"`
	OS           string                `json:"os"`
	Config       ImageConfig           `json:"config,omitempty"`
	RootFS       ocischemav1.RootFS    `json:"rootfs"`
	History      []ocischemav1.History `json:"history,omitempty"`
}

Image is copied from ocischemav1 (except the Config)

type ImageConfig added in v1.0.4

type ImageConfig struct {
	// ImageConfig defines the execution parameters which should be used as a base when running a container using an image.
	Entrypoint []string `json:"Entrypoint,omitempty"`
	WorkingDir string   `json:"WorkingDir,omitempty"`

	Healthcheck *HealthcheckConfig  `json:"Healthcheck,omitempty"`
	Volumes     map[string]struct{} `json:"Volumes,omitempty"`
	Labels      map[string]string   `json:"Labels,omitempty"`
}

ImageConfig is copied from ocischemav1.ImageConfig, only selecting used item and adding:

  • healthcheck

type Layer

type Layer struct {
}

type TarItem

type TarItem struct {
	File        string
	Destination string
}

Jump to

Keyboard shortcuts

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