Documentation ¶
Index ¶
- Constants
- type BundleBuilder
- type HookBuilder
- func (b *HookBuilder) AddDnsNameserver(nameserver string)
- func (b *HookBuilder) AddDnsOption(opt string)
- func (b *HookBuilder) AddDnsSearch(search string)
- func (b *HookBuilder) AddHost(host, ip string)
- func (b *HookBuilder) AddNetwork(networkID string)
- func (b *HookBuilder) AddPortMapEntry(entry PortMapEntry)
- func (b *HookBuilder) Build(spec *generate.Generator) (err error)
- func (b *HookBuilder) SetDomainname(domainname string)
- func (b *HookBuilder) SetIPAMDataDir(ipamDataDir string)
- type NetConfig
- type PortMapEntry
- type SpecBuilder
- func (b *SpecBuilder) AddAllProcessCapabilities()
- func (b *SpecBuilder) AddExposedPorts(ports []string)
- func (b *SpecBuilder) AddPRootPortMapping(published, target string)
- func (b *SpecBuilder) ApplyImage(img *ispecs.Image)
- func (b *SpecBuilder) DropAllProcessCapabilities()
- func (b *SpecBuilder) SetLinuxSeccomp(profile *rspecs.LinuxSeccomp)
- func (b *SpecBuilder) SetLinuxSeccompDefault()
- func (b *SpecBuilder) SetLinuxSeccompUnconfined()
- func (b *SpecBuilder) SetPRootPath(prootPath string)
- func (b *SpecBuilder) SetProcessCmd(v []string)
- func (b *SpecBuilder) SetProcessEntrypoint(v []string)
- func (b *SpecBuilder) SetProcessUser(user idutils.User)
- func (b *SpecBuilder) Spec(rootfs string) (spec *rspecs.Spec, err error)
- func (b *SpecBuilder) ToRootless()
- func (b *SpecBuilder) UseHostNetwork()
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) 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 ¶
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) SetLinuxSeccompDefault ¶
func (b *SpecBuilder) SetLinuxSeccompDefault()
Derives a sane default seccomp profile from the current spec. See https://github.com/jessfraz/blog/blob/master/content/post/how-to-use-new-docker-seccomp-profiles.md and https://github.com/jessfraz/docker/blob/52f32818df8bad647e4c331878fa44317e724939/docs/security/seccomp.md
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()
Click to show internal directories.
Click to hide internal directories.