moby

package
v0.0.0-...-1ff0e3b Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MobyDir is the location of the cache directory which should be set by the caller
	MobyDir string
)
View Source
var (
	// ReleasesRole is the role named "releases"
	ReleasesRole = path.Join(data.CanonicalTargetsRole, "releases")
)

Functions

func Build

func Build(m Moby, w io.Writer, pull bool, tp string) error

Build performs the actual build process

func Formats

func Formats(base string, image []byte, formats []string, size int, hyperkit bool) error

Formats generates all the specified output formats

func GetReadOnlyAuthTransport

func GetReadOnlyAuthTransport(server string, scopes []string, username, password, rootCAPath string) (http.RoundTripper, error)

GetReadOnlyAuthTransport gets the Auth Transport used to communicate with notary

func ImageBundle

func ImageBundle(prefix string, image string, config []byte, runtime Runtime, tw tarWriter, trust bool, pull bool, readonly bool, dupMap map[string]string) error

ImageBundle produces an OCI bundle at the given path in a tarball, given an image and a config.json

func ImageTar

func ImageTar(image, prefix string, tw tarWriter, trust bool, pull bool, resolv string) error

ImageTar takes a Docker image and outputs it to a tar stream

func OutputTypes

func OutputTypes() []string

OutputTypes returns a list of the valid output types

func Streamable

func Streamable(t string) bool

Streamable returns true if an output can be streamed

func TrustedReference

func TrustedReference(image string) (reference.Reference, error)

TrustedReference parses an image string, and does a notary lookup to verify and retrieve the signed digest reference

func ValidateFormats

func ValidateFormats(formats []string) error

ValidateFormats checks if the format type is known

Types

type File

type File struct {
	Path      string      `yaml:"path" json:"path"`
	Directory bool        `yaml:"directory" json:"directory"`
	Symlink   string      `yaml:"symlink" json:"symlink,omitempty"`
	Contents  *string     `yaml:"contents" json:"contents,omitempty"`
	Source    string      `yaml:"source" json:"source,omitempty"`
	Metadata  string      `yaml:"metadata" json:"metadata,omitempty"`
	Optional  bool        `yaml:"optional" json:"optional"`
	Mode      string      `yaml:"mode" json:"mode,omitempty"`
	UID       interface{} `yaml:"uid" json:"uid,omitempty"`
	GID       interface{} `yaml:"gid" json:"gid,omitempty"`
}

File is the type of a file specification

type Image

type Image struct {
	Name              string                  `yaml:"name" json:"name"`
	Image             string                  `yaml:"image" json:"image"`
	Capabilities      *[]string               `yaml:"capabilities" json:"capabilities,omitempty"`
	Ambient           *[]string               `yaml:"ambient" json:"ambient,omitempty"`
	Mounts            *[]specs.Mount          `yaml:"mounts" json:"mounts,omitempty"`
	Binds             *[]string               `yaml:"binds" json:"binds,omitempty"`
	Tmpfs             *[]string               `yaml:"tmpfs" json:"tmpfs,omitempty"`
	Command           *[]string               `yaml:"command" json:"command,omitempty"`
	Env               *[]string               `yaml:"env" json:"env,omitempty"`
	Cwd               string                  `yaml:"cwd" json:"cwd,omitempty"`
	Net               string                  `yaml:"net" json:"net,omitempty"`
	Pid               string                  `yaml:"pid" json:"pid,omitempty"`
	Ipc               string                  `yaml:"ipc" json:"ipc,omitempty"`
	Uts               string                  `yaml:"uts" json:"uts,omitempty"`
	Userns            string                  `yaml:"userns" json:"userns,omitempty"`
	Hostname          string                  `yaml:"hostname" json:"hostname,omitempty"`
	Readonly          *bool                   `yaml:"readonly" json:"readonly,omitempty"`
	MaskedPaths       *[]string               `yaml:"maskedPaths" json:"maskedPaths,omitempty"`
	ReadonlyPaths     *[]string               `yaml:"readonlyPaths" json:"readonlyPaths,omitempty"`
	UID               *interface{}            `yaml:"uid" json:"uid,omitempty"`
	GID               *interface{}            `yaml:"gid" json:"gid,omitempty"`
	AdditionalGids    *[]interface{}          `yaml:"additionalGids" json:"additionalGids,omitempty"`
	NoNewPrivileges   *bool                   `yaml:"noNewPrivileges" json:"noNewPrivileges,omitempty"`
	OOMScoreAdj       *int                    `yaml:"oomScoreAdj" json:"oomScoreAdj,omitempty"`
	RootfsPropagation *string                 `yaml:"rootfsPropagation" json:"rootfsPropagation,omitempty"`
	CgroupsPath       *string                 `yaml:"cgroupsPath" json:"cgroupsPath,omitempty"`
	Resources         *specs.LinuxResources   `yaml:"resources" json:"resources,omitempty"`
	Sysctl            *map[string]string      `yaml:"sysctl" json:"sysctl,omitempty"`
	Rlimits           *[]string               `yaml:"rlimits" json:"rlimits,omitempty"`
	UIDMappings       *[]specs.LinuxIDMapping `yaml:"uidMappings" json:"uidMappings,omitempty"`
	GIDMappings       *[]specs.LinuxIDMapping `yaml:"gidMappings" json:"gidMappings,omitempty"`
	Runtime           *Runtime                `yaml:"runtime" json:"runtime,omitempty"`
}

Image is the type of an image config

func NewImage

func NewImage(config []byte) (Image, error)

NewImage validates an parses yaml or json for a Image

type Interface

type Interface struct {
	Name         string `yaml:"name" json:"name,omitempty"`
	Add          string `yaml:"add" json:"add,omitempty"`
	Peer         string `yaml:"peer" json:"peer,omitempty"`
	CreateInRoot bool   `yaml:"createInRoot" json:"createInRoot"`
}

Interface is the runtime config for network interfaces

type KernelConfig

type KernelConfig struct {
	Image   string  `yaml:"image" json:"image"`
	Cmdline string  `yaml:"cmdline" json:"cmdline,omitempty"`
	Binary  string  `yaml:"binary" json:"binary,omitempty"`
	Tar     *string `yaml:"tar" json:"tar,omitempty"`
}

KernelConfig is the type of the config for a kernel

type Moby

type Moby struct {
	Kernel     KernelConfig `kernel:"cmdline" json:"kernel,omitempty"`
	Init       []string     `init:"cmdline" json:"init"`
	Onboot     []Image      `yaml:"onboot" json:"onboot"`
	Onshutdown []Image      `yaml:"onshutdown" json:"onshutdown"`
	Services   []Image      `yaml:"services" json:"services"`
	Trust      TrustConfig  `yaml:"trust" json:"trust,omitempty"`
	Files      []File       `yaml:"files" json:"files"`
}

Moby is the type of a Moby config file

func AppendConfig

func AppendConfig(m0, m1 Moby) (Moby, error)

AppendConfig appends two configs.

func NewConfig

func NewConfig(config []byte) (Moby, error)

NewConfig parses a config file

type Namespaces

type Namespaces struct {
	Cgroup string `yaml:"cgroup" json:"cgroup,omitempty"`
	Ipc    string `yaml:"ipc" json:"ipc,omitempty"`
	Mnt    string `yaml:"mnt" json:"mnt,omitempty"`
	Net    string `yaml:"net" json:"net,omitempty"`
	Pid    string `yaml:"pid" json:"pid,omitempty"`
	User   string `yaml:"user" json:"user,omitempty"`
	Uts    string `yaml:"uts" json:"uts,omitempty"`
}

Namespaces is the type for configuring paths to bind namespaces

type Runtime

type Runtime struct {
	Mounts     []specs.Mount `yaml:"mounts" json:"mounts,omitempty"`
	Mkdir      []string      `yaml:"mkdir" json:"mkdir,omitempty"`
	Interfaces []Interface   `yaml:"interfaces" json:"interfaces,omitempty"`
	BindNS     Namespaces    `yaml:"bindNS" json:"bindNS,omitempty"`
}

Runtime is the type of config processed at runtime, not used to build the OCI spec

func ConfigInspectToOCI

func ConfigInspectToOCI(yaml Image, inspect types.ImageInspect, idMap map[string]uint32) (specs.Spec, Runtime, error)

ConfigInspectToOCI converts a config and the output of image inspect to an OCI config

func ConfigToOCI

func ConfigToOCI(image Image, trust bool, idMap map[string]uint32) (specs.Spec, Runtime, error)

ConfigToOCI converts a config specification to an OCI config file and a runtime config

type TrustConfig

type TrustConfig struct {
	Image []string `yaml:"image" json:"image,omitempty"`
	Org   []string `yaml:"org" json:"org,omitempty"`
}

TrustConfig is the type of a content trust config

Jump to

Keyboard shortcuts

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