spec

package
v0.0.0-...-e411b72 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

type Process struct {
	// Terminal creates an interactive terminal for the container
	Terminal bool `json:"terminal,omitempty"`
	// Args specifies the binary and arguments for the application to execute
	Args []string `json:"args,omitempty"`
	// Env populates the process environment for the process
	Env []string `json:"env,omitempty"`
	// Cwd is the current working directory for the process and must be
	// relative to the container's root
	Cwd string `json:"cwd"`
}

Process contains information to start a specific application inside the container.

func (Process) Valid

func (p Process) Valid() error

Valid validates the app spec running inside the box, returning an error if it is not valid.

type Root

type Root struct {
	// Path is the absolute path to the container's root filesystem
	Path string `json:"path"`
	// TODO: not fully implemented yet
	// Readonly makes the root filesystem for the container readonly before the process is executed
	Readonly bool `json:"readonly,omitempty"`
}

Root contains information about the container's root filesystem on the host

func (Root) Valid

func (r Root) Valid() error

Valid validates the container's root filesystem, returning an error if it is not valid.

type Spec

type Spec struct {
	// Version of the Open Container Initiative Runtime Specification with which the bundle complies
	Version string `json:"ociVersion"`
	// Process configures the container process.
	Process *Process `json:"process,omitempty"`
	// Root configures the container's root filesystem.
	Root *Root `json:"root,omitempty"`
	// Hostname configures the container's hostname.
	Hostname string `json:"hostname,omitempty"`
}

Spec is the base configuration for the container. Check https://github.com/opencontainers/runtime-spec/blob/master/config.md for more details. If you cannot find here a field documented in the link above, is because it is not supported.

func Load

func Load(rd io.Reader) (spec *Spec, err error)

Load a Box spec from the given reader.

func LoadFromFile

func LoadFromFile(path string) (spec *Spec, err error)

LoadFromFile a Box spec in the given path.

func (Spec) Valid

func (s Spec) Valid() error

Valid validates a spec, returning an error if it is not valid.

Jump to

Keyboard shortcuts

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