image

package
v0.0.0-...-f1bde72 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2019 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoOS = errors.New("no os version specified")

Functions

func Fetch

func Fetch(ctx context.Context, http bool, cs content.Store, imageName string) (*v1.Descriptor, error)

func Get

func Get(ctx context.Context, client *containerd.Client, ref string, clix *cli.Context, out io.Writer, unpack bool) (containerd.Image, error)

func HostFilter

func HostFilter(h *tar.Header) (bool, error)

func NewContentStore

func NewContentStore(root string) (content.Store, error)

func Push

func Push(ctx context.Context, client *containerd.Client, ref string, clix *cli.Context) error

func Unpack

func Unpack(ctx context.Context, cs content.Store, desc *v1.Descriptor, dest string) error

Types

type DockerConfig

type DockerConfig struct {
	Auths map[string]RegistryAuth `json:"auths"`
}

DockerConfig is the docker config struct

type History

type History struct {
	// Created is the combined date and time at which the layer was created, formatted as defined by RFC 3339, section 5.6.
	Created *time.Time `json:"created,omitempty"`

	// CreatedBy is the command which created the layer.
	CreatedBy string `json:"created_by,omitempty"`

	// Author is the author of the build point.
	Author string `json:"author,omitempty"`

	// Comment is a custom message set when creating the layer.
	Comment string `json:"comment,omitempty"`

	// EmptyLayer is used to mark if the history item created a filesystem diff.
	EmptyLayer bool `json:"empty_layer,omitempty"`
}

History describes the history of a layer.

type Image

type Image struct {
	// Created is the combined date and time at which the image was created, formatted as defined by RFC 3339, section 5.6.
	Created *time.Time `json:"created,omitempty"`

	// Author defines the name and/or email address of the person or entity which created and is responsible for maintaining the image.
	Author string `json:"author,omitempty"`

	// Architecture is the CPU architecture which the binaries in this image are built to run on.
	Architecture string `json:"architecture"`

	// OS is the name of the operating system which the image is built to run on.
	OS string `json:"os"`

	// Config defines the execution parameters which should be used as a base when running a container using the image.
	Config ImageConfig `json:"config,omitempty"`

	// RootFS references the layer content addresses used by the image.
	RootFS RootFS `json:"rootfs"`

	// History describes the history of each layer.
	History []History `json:"history,omitempty"`
}

Image is the JSON structure which describes some basic information about the image. This provides the `application/vnd.oci.image.config.v1+json` mediatype when marshalled to JSON.

type ImageConfig

type ImageConfig struct {
	// User defines the username or UID which the process in the container should run as.
	User string `json:"User,omitempty"`

	// ExposedPorts a set of ports to expose from a container running this image.
	ExposedPorts map[string]struct{} `json:"ExposedPorts,omitempty"`

	// Env is a list of environment variables to be used in a container.
	Env []string `json:"Env,omitempty"`

	// Entrypoint defines a list of arguments to use as the command to execute when the container starts.
	Entrypoint []string `json:"Entrypoint,omitempty"`

	// Cmd defines the default arguments to the entrypoint of the container.
	Cmd []string `json:"Cmd,omitempty"`

	// Volumes is a set of directories describing where the process is likely write data specific to a container instance.
	Volumes map[string]struct{} `json:"Volumes,omitempty"`

	// WorkingDir sets the current working directory of the entrypoint process in the container.
	WorkingDir string `json:"WorkingDir,omitempty"`

	// Labels contains arbitrary metadata for the container.
	Labels map[string]string `json:"Labels,omitempty"`

	// StopSignal contains the system call signal that will be sent to the container to exit.
	StopSignal string `json:"StopSignal,omitempty"`

	OnBuild []string `json:"OnBuild,omitempty"`
}

ImageConfig defines the execution parameters which should be used as a base when running a container using an image.

type RegistryAuth

type RegistryAuth struct {
	Auth string `json:"auth,omitempty"`
}

RegistryAuth is the base64 encoded credentials for the registry credentials

type Repo

type Repo string

func GetRepo

func GetRepo(clix *cli.Context) (Repo, error)

func (Repo) Version

func (r Repo) Version() string

type RootFS

type RootFS struct {
	// Type is the type of the rootfs.
	Type string `json:"type"`

	// DiffIDs is an array of layer content hashes (DiffIDs), in order from bottom-most to top-most.
	DiffIDs []digest.Digest `json:"diff_ids"`
}

RootFS describes a layer content addresses

Jump to

Keyboard shortcuts

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