image

package
v0.0.0-...-25f2897 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthConfig

type HealthConfig struct {
	// Test is the test to perform to check that the container is healthy.
	// An empty slice means to inherit the default.
	// The options are:
	// {} : inherit healthcheck
	// {"NONE"} : disable healthcheck
	// {"CMD", args...} : exec arguments directly
	// {"CMD-SHELL", command} : run command with system's default shell
	Test []string `json:",omitempty"`

	// Zero means to inherit. Durations are expressed as integer nanoseconds.
	Interval    time.Duration `json:",omitempty"` // Interval is the time to wait between checks.
	Timeout     time.Duration `json:",omitempty"` // Timeout is the time to wait before considering the check to have hung.
	StartPeriod time.Duration `json:",omitempty"` // The start period for the container to initialize before the retries starts to count down.

	// Retries is the number of consecutive failures needed to consider a container as unhealthy.
	// Zero means inherit.
	Retries int `json:",omitempty"`
}

HealthConfig represents the healthcheck configuration used by Docker. It comes from: https://github.com/moby/buildkit/blob/2b2bdac1b84b33dcac99211c0a0f0b50c93e0e8f/frontend/dockerfile/dockerfile2llb/image.go#L12

type Image

type Image struct {
	specs.Image

	Config ImageConfig `json:"config,omitempty"`
}

Image represents a OCI compliant image with extra fields for Docker (e.g. Healthcheck).

func CloneMeta

func CloneMeta(src *Image) *Image

CloneMeta does a deep copy of the given Image and returns the copied Image.

func LoadMeta

func LoadMeta(ctx context.Context, imageRef string) (*Image, error)

LoadMeta looks for image metadata for the given imageRef. It returns an Image when metadata could be found and an error otherwise.

type ImageConfig

type ImageConfig struct {
	specs.ImageConfig

	Healthcheck *HealthConfig `json:",omitempty"`
}

ImageConfig represents a OCI compliant image config with extra fields for Docker (e.g. Healthcheck).

Jump to

Keyboard shortcuts

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