builder

package
v0.7.1-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Index

Constants

View Source
const ANNOTATION_HOOK_ARGS = "com.github.mgoltzsche.ctnr.bundle.hook.args"

Variables

This section is empty.

Functions

This section is empty.

Types

type BundleBuilder

type BundleBuilder struct {
	*SpecBuilder
	// contains filtered or unexported fields
}

func Builder

func Builder(id string) *BundleBuilder

func (*BundleBuilder) AddBindMountConfig

func (b *BundleBuilder) AddBindMountConfig(path string)

Overlays the provided file path with a bind mounted read-only copy. The file's content is supposed to be managed by an OCI hook.

func (*BundleBuilder) Build

func (b *BundleBuilder) Build(bundle *bundle.LockedBundle) (err error)

func (*BundleBuilder) SetID

func (b *BundleBuilder) SetID(id string)

func (*BundleBuilder) SetImage

func (b *BundleBuilder) SetImage(image bundle.BundleImage)

type HookBuilder

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

func NewHookBuilderFromSpec

func NewHookBuilderFromSpec(spec *specs.Spec) (b HookBuilder, err error)

func (*HookBuilder) AddDnsNameserver

func (b *HookBuilder) AddDnsNameserver(nameserver string)

func (*HookBuilder) AddDnsOption

func (b *HookBuilder) AddDnsOption(opt string)

func (*HookBuilder) AddDnsSearch

func (b *HookBuilder) AddDnsSearch(search string)

func (*HookBuilder) AddHost

func (b *HookBuilder) AddHost(host, ip string)

func (*HookBuilder) AddNetwork

func (b *HookBuilder) AddNetwork(networkID string)

func (*HookBuilder) AddPortMapEntry

func (b *HookBuilder) AddPortMapEntry(entry PortMapEntry)

func (*HookBuilder) Build

func (b *HookBuilder) Build(spec *generate.Generator) (err error)

func (*HookBuilder) SetDomainname

func (b *HookBuilder) SetDomainname(domainname string)

func (*HookBuilder) SetIPAMDataDir

func (b *HookBuilder) SetIPAMDataDir(ipamDataDir string)

type NetConfig

type NetConfig struct {
	DnsNameserver []string          `json:"dns,omitempty"`
	DnsSearch     []string          `json:"dns_search,omitempty"`
	DnsOptions    []string          `json:"dns_options,omitempty"`
	Domainname    string            `json:"domainname,omitempty"`
	Hosts         map[string]string `json:"hosts,omitempty"`
	Networks      []string          `json:"networks,omitempty"`
	Ports         []PortMapEntry    `json:"ports,omitempty"`
	IPAMDataDir   string            `json:"dataDir,omitempty"`
}

type PortMapEntry

type PortMapEntry struct {
	Target    uint16 `json:"target"`
	Published uint16 `json:"published,omitempty"`
	Protocol  string `json:"protocol,omitempty"`
	IP        string `json:"ip,omitempty"`
}

func (PortMapEntry) String

func (p PortMapEntry) String() string

type SpecBuilder

type SpecBuilder struct {
	generate.Generator
	// contains filtered or unexported fields
}

func FromSpec

func FromSpec(spec *rspecs.Spec) SpecBuilder

func NewSpecBuilder

func NewSpecBuilder() SpecBuilder

func (*SpecBuilder) AddAllProcessCapabilities

func (b *SpecBuilder) AddAllProcessCapabilities()

func (*SpecBuilder) AddExposedPorts

func (b *SpecBuilder) AddExposedPorts(ports []string)

func (*SpecBuilder) AddPRootPortMapping

func (b *SpecBuilder) AddPRootPortMapping(published, target string)

func (*SpecBuilder) ApplyImage

func (b *SpecBuilder) ApplyImage(img *ispecs.Image)

See image to runtime spec conversion rules: https://github.com/opencontainers/image-spec/blob/master/conversion.md

func (*SpecBuilder) DropAllProcessCapabilities

func (b *SpecBuilder) DropAllProcessCapabilities()

func (*SpecBuilder) SetLinuxSeccomp

func (b *SpecBuilder) SetLinuxSeccomp(profile *rspecs.LinuxSeccomp)

func (*SpecBuilder) SetLinuxSeccompUnconfined

func (b *SpecBuilder) SetLinuxSeccompUnconfined()

func (*SpecBuilder) SetPRootPath

func (b *SpecBuilder) SetPRootPath(prootPath string)

func (*SpecBuilder) SetProcessCmd

func (b *SpecBuilder) SetProcessCmd(v []string)

func (*SpecBuilder) SetProcessEntrypoint

func (b *SpecBuilder) SetProcessEntrypoint(v []string)

func (*SpecBuilder) SetProcessUser

func (b *SpecBuilder) SetProcessUser(user idutils.User)

func (*SpecBuilder) Spec

func (b *SpecBuilder) Spec(rootfs string) (spec *rspecs.Spec, err error)

Returns the generated spec with resolved user/group names

func (*SpecBuilder) ToRootless

func (b *SpecBuilder) ToRootless()

func (*SpecBuilder) UseHostNetwork

func (b *SpecBuilder) UseHostNetwork()

Jump to

Keyboard shortcuts

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