lib

package
v0.0.0-...-21b60f4 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2017 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BuildModeAppC = BuildMode("appc")
	BuildModeOCI  = BuildMode("oci")
)
View Source
const OCISchemaVersion = 2

Variables

View Source
var OCILayoutValue = OCILayout{"1.0.0"}
View Source
var Version = "0.0.0+was-not-built-correctly"

Functions

This section is empty.

Types

type ACBuild

type ACBuild struct {
	ContextPath          string
	LockPath             string
	CurrentImagePath     string
	DepStoreTarPath      string
	DepStoreExpandedPath string
	OverlayTargetPath    string
	OverlayWorkPath      string
	BuildModePath        string
	OCIExpandedBlobsPath string
	Debug                bool
	Mode                 BuildMode
	// contains filtered or unexported fields
}

ACBuild contains all the information for a current build. Once an ACBuild has been created, the functions available on it will perform different actions in the build, like updating a dependency or writing a finished ACI.

func NewACBuild

func NewACBuild(cwd string, debug bool, buildMode BuildMode) (*ACBuild, error)

NewACBuild returns a new ACBuild struct with sane defaults for all of the different paths

func (*ACBuild) AddAnnotation

func (a *ACBuild) AddAnnotation(name, value string) (err error)

func (*ACBuild) AddDependency

func (a *ACBuild) AddDependency(imageName types.ACIdentifier, imageId *types.Hash, labels types.Labels, size uint) (err error)

func (*ACBuild) AddEnv

func (a *ACBuild) AddEnv(name, value string) (err error)

func (*ACBuild) AddIsolator

func (a *ACBuild) AddIsolator(name string, value []byte) (err error)

func (*ACBuild) AddLabel

func (a *ACBuild) AddLabel(name, value string) (err error)

func (*ACBuild) AddMount

func (a *ACBuild) AddMount(name, path string, readOnly bool) (err error)

func (*ACBuild) AddPort

func (a *ACBuild) AddPort(name, protocol string, port, count uint, socketActivated bool) (err error)

func (*ACBuild) Begin

func (a *ACBuild) Begin(start string, insecure bool, mode BuildMode) (err error)

Begin will start a new build, storing the untarred image the build operates on at a.CurrentImagePath. If start is the empty string, the build will begin with an empty image, otherwise the image stored at start will be used at the starting point. The mode parameter specifies whether this is starting with an AppC or OCI image.

func (*ACBuild) CopyToDir

func (a *ACBuild) CopyToDir(froms []string, to string) (err error)

CopyToDir will copy all elements specified in the froms slice into the directory inside the current ACI specified by the to string.

func (*ACBuild) CopyToTarget

func (a *ACBuild) CopyToTarget(from string, to string) (err error)

CopyToTarget will copy a single file/directory from the from string to the path specified by the to string inside the current ACI.

func (*ACBuild) End

func (a *ACBuild) End() error

End will stop the current build. An error will be returned if no build is in progress.

func (*ACBuild) GetAnnotations

func (a *ACBuild) GetAnnotations() (m map[string]string, err error)

func (*ACBuild) NewLayer

func (a *ACBuild) NewLayer() (err error)

func (*ACBuild) Print

func (a *ACBuild) Print(w io.Writer, prettyPrint, printConfig bool) (err error)

func (*ACBuild) RemoveAnnotation

func (a *ACBuild) RemoveAnnotation(name string) (err error)

func (*ACBuild) RemoveDependency

func (a *ACBuild) RemoveDependency(imageName string) (err error)

func (*ACBuild) RemoveEnv

func (a *ACBuild) RemoveEnv(name string) (err error)

func (*ACBuild) RemoveIsolator

func (a *ACBuild) RemoveIsolator(imageName string) (err error)

func (*ACBuild) RemoveLabel

func (a *ACBuild) RemoveLabel(name string) (err error)

func (*ACBuild) RemoveMount

func (a *ACBuild) RemoveMount(name string) (err error)

func (*ACBuild) RemovePort

func (a *ACBuild) RemovePort(name string) (err error)

func (*ACBuild) Replace

func (a *ACBuild) Replace(manifestPath string) (err error)

func (*ACBuild) Run

func (a *ACBuild) Run(cmd []string, workingDir string, insecure bool, runEngine engine.Engine) (err error)

Run will execute the given command in the ACI being built. a.CurrentImagePath is where the untarred ACI is stored, a.DepStoreTarPath is the directory to download dependencies into, a.DepStoreExpandedPath is where the dependencies are expanded into, and a.OverlayWorkPath is the work directory used by overlayfs.

Arguments:

- cmd: The command to run and its arguments.

- workingDir: If specified, the current directory inside the container is changed to its value before running the given command.

- runEngine: The engine used to perform the execution of the command.

func (*ACBuild) SetExec

func (a *ACBuild) SetExec(cmd []string) (err error)

func (*ACBuild) SetGroup

func (a *ACBuild) SetGroup(group string) (err error)

func (*ACBuild) SetName

func (a *ACBuild) SetName(name string) (err error)

func (*ACBuild) SetPostStop

func (a *ACBuild) SetPostStop(exec []string) (err error)

func (*ACBuild) SetPreStart

func (a *ACBuild) SetPreStart(exec []string) (err error)

func (*ACBuild) SetSuppGroups

func (a *ACBuild) SetSuppGroups(groups []int) (err error)

func (*ACBuild) SetTag

func (a *ACBuild) SetTag(tag string) (err error)

func (*ACBuild) SetUser

func (a *ACBuild) SetUser(user string) (err error)

func (*ACBuild) SetWorkingDir

func (a *ACBuild) SetWorkingDir(dir string) (err error)

func (*ACBuild) Write

func (a *ACBuild) Write(output string, overwrite bool) (id string, err error)

Write will produce the resulting image from the current build context, saving it to the given path, optionally signing it.

type BuildMode

type BuildMode string

BuildMode represents which image spec is being followed during a build, AppC or OCI

func GetBuildMode

func GetBuildMode(cwd string) (BuildMode, error)

type Manifest

type Manifest interface {
	Print(w io.Writer, prettyPrint, printConfig bool) error // Print out this manifest to the given writer

	GetAnnotations() (map[string]string, error) // Used to generate build history

	AddAnnotation(name, value string) error
	AddEnv(name, value string) error
	AddLabel(name, value string) error
	AddMount(name, path string, readOnly bool) error
	AddPort(name, protocol string, port, count uint, socketActivated bool) error
	RemoveAnnotation(name string) error
	RemoveEnv(name string) error
	RemoveLabel(name string) error
	RemoveMount(name string) error
	RemovePort(name string) error
	Replace(manifestPath string) error
	SetExec(cmd []string) error
	SetGroup(group string) error
	SetUser(user string) error
	SetWorkingDir(dir string) error
	SetTag(tag string) error
}

Manifest defines something that can manipulate manifests. The functions contained in it are the common subset of fields between appc and oci that can be altered by a user.

type OCILayout

type OCILayout struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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