Documentation ¶
Index ¶
- Constants
- func MutateRuntimeSpec(g rgen.Generator, rootfs string, image ispec.Image, manifest ispec.Manifest) error
- func ToRuntimeSpec(rootfs string, image ispec.Image, manifest ispec.Manifest) (rspec.Spec, error)
- type Generator
- func (g *Generator) AddConfigEnv(name, value string)
- func (g *Generator) AddConfigExposedPort(port string)
- func (g *Generator) AddConfigLabel(label, value string)
- func (g *Generator) AddConfigVolume(volume string)
- func (g *Generator) AddHistory(history ispec.History)
- func (g *Generator) AddRootfsDiffID(diffid string)
- func (g *Generator) Architecture() string
- func (g *Generator) Author() string
- func (g *Generator) ClearConfigEnv()
- func (g *Generator) ClearConfigExposedPorts()
- func (g *Generator) ClearConfigLabels()
- func (g *Generator) ClearConfigVolumes()
- func (g *Generator) ClearHistory()
- func (g *Generator) ClearRootfsDiffIDs()
- func (g *Generator) ConfigCmd() []string
- func (g *Generator) ConfigEntrypoint() []string
- func (g *Generator) ConfigEnv() []string
- func (g *Generator) ConfigExposedPorts() map[string]struct{}
- func (g *Generator) ConfigLabels() map[string]string
- func (g *Generator) ConfigUser() string
- func (g *Generator) ConfigVolumes() map[string]struct{}
- func (g *Generator) ConfigWorkingDir() string
- func (g *Generator) Created() time.Time
- func (g *Generator) History() []ispec.History
- func (g *Generator) Image() ispec.Image
- func (g *Generator) OS() string
- func (g *Generator) RemoveConfigExposedPort(port string)
- func (g *Generator) RemoveConfigLabel(label string)
- func (g *Generator) RemoveConfigVolume(volume string)
- func (g *Generator) RootfsDiffIDs() []string
- func (g *Generator) RootfsType() string
- func (g *Generator) SetArchitecture(arch string)
- func (g *Generator) SetAuthor(author string)
- func (g *Generator) SetConfigCmd(cmd []string)
- func (g *Generator) SetConfigEntrypoint(entrypoint []string)
- func (g *Generator) SetConfigUser(user string)
- func (g *Generator) SetConfigWorkingDir(workingDir string)
- func (g *Generator) SetCreated(created time.Time)
- func (g *Generator) SetOS(os string)
- func (g *Generator) SetRootfsType(rootfsType string)
- func (g *Generator) WriteTo(w io.Writer) (n int64, err error)
Constants ¶
const ISO8601 = time.RFC3339Nano
ISO8601 represents the format of an ISO-8601 time string, which is identical to Go's RFC3339 specification.
Variables ¶
This section is empty.
Functions ¶
func MutateRuntimeSpec ¶
func MutateRuntimeSpec(g rgen.Generator, rootfs string, image ispec.Image, manifest ispec.Manifest) error
MutateRuntimeSpec mutates a given runtime specification generator with the image configuration provided. It returns the original generator, and does not modify any fields directly (to allow for chaining).
func ToRuntimeSpec ¶
ToRuntimeSpec converts the given OCI image configuration to a runtime configuration appropriate for use, which is templated on the default configuration specified by the OCI runtime-tools. It is equivalent to MutateRuntimeSpec("runtime-tools/generate".New(), image).Spec().
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator allows you to generate a mutable OCI image-spec configuration which can be written to a file (and its digest computed). It is the recommended way of handling modification and generation of image-spec configuration blobs.
func New ¶
func New() *Generator
New creates a new Generator with the inital template set to a default. It is not recommended to leave any of the options as their default values (they may change in the future without warning and may be invalid images).
func NewFromImage ¶
NewFromImage generates a new generator with the initial template being the given ispec.Image.
func (*Generator) AddConfigEnv ¶
AddConfigEnv appends to the list of environment variables to be used in a container.
func (*Generator) AddConfigExposedPort ¶
AddConfigExposedPort adds a port the set of ports to expose from a container running this image.
func (*Generator) AddConfigLabel ¶
AddConfigLabel adds a label to the set of arbitrary metadata for the container.
func (*Generator) AddConfigVolume ¶
AddConfigVolume adds a volume to the set of directories which should be created as data volumes in a container running this image.
func (*Generator) AddHistory ¶
AddHistory appends to the history of the layers.
func (*Generator) AddRootfsDiffID ¶
AddRootfsDiffID appends to the array of layer content hashes (DiffIDs), in order from bottom-most to top-most.
func (*Generator) Architecture ¶
Architecture returns the CPU architecture which the binaries in this image are built to run on.
func (*Generator) Author ¶
Author returns the name and/or email address of the person or entity which created and is responsible for maintaining the image.
func (*Generator) ClearConfigEnv ¶
func (g *Generator) ClearConfigEnv()
ClearConfigEnv clears the list of environment variables to be used in a container.
func (*Generator) ClearConfigExposedPorts ¶
func (g *Generator) ClearConfigExposedPorts()
ClearConfigExposedPorts clears the set of ports to expose from a container running this image.
func (*Generator) ClearConfigLabels ¶
func (g *Generator) ClearConfigLabels()
ClearConfigLabels clears the set of arbitrary metadata for the container.
func (*Generator) ClearConfigVolumes ¶
func (g *Generator) ClearConfigVolumes()
ClearConfigVolumes clears the set of directories which should be created as data volumes in a container running this image.
func (*Generator) ClearHistory ¶
func (g *Generator) ClearHistory()
ClearHistory clears the history of each layer.
func (*Generator) ClearRootfsDiffIDs ¶
func (g *Generator) ClearRootfsDiffIDs()
ClearRootfsDiffIDs clears the array of layer content hashes (DiffIDs), in order from bottom-most to top-most.
func (*Generator) ConfigCmd ¶
ConfigCmd returns the list of default arguments to the entrypoint of the container.
func (*Generator) ConfigEntrypoint ¶
ConfigEntrypoint returns the list of arguments to use as the command to execute when the container starts.
func (*Generator) ConfigEnv ¶
ConfigEnv returns the list of environment variables to be used in a container.
func (*Generator) ConfigExposedPorts ¶
ConfigExposedPorts returns the set of ports to expose from a container running this image.
func (*Generator) ConfigLabels ¶
ConfigLabels returns the set of arbitrary metadata for the container.
func (*Generator) ConfigUser ¶
ConfigUser returns the username or UID which the process in the container should run as.
func (*Generator) ConfigVolumes ¶
ConfigVolumes returns the set of directories which should be created as data volumes in a container running this image.
func (*Generator) ConfigWorkingDir ¶
ConfigWorkingDir returns the current working directory of the entrypoint process in the container.
func (*Generator) OS ¶
OS returns the name of the operating system which the image is built to run on.
func (*Generator) RemoveConfigExposedPort ¶
RemoveConfigExposedPort removes a port the set of ports to expose from a container running this image.
func (*Generator) RemoveConfigLabel ¶
RemoveConfigLabel removes a label from the set of arbitrary metadata for the container.
func (*Generator) RemoveConfigVolume ¶
RemoveConfigVolume removes a volume from the set of directories which should be created as data volumes in a container running this image.
func (*Generator) RootfsDiffIDs ¶
RootfsDiffIDs returns the the array of layer content hashes (DiffIDs), in order from bottom-most to top-most.
func (*Generator) RootfsType ¶
RootfsType returns the type of the rootfs.
func (*Generator) SetArchitecture ¶
SetArchitecture is the CPU architecture which the binaries in this image are built to run on.
func (*Generator) SetAuthor ¶
SetAuthor sets the name and/or email address of the person or entity which created and is responsible for maintaining the image.
func (*Generator) SetConfigCmd ¶
SetConfigCmd sets the list of default arguments to the entrypoint of the container.
func (*Generator) SetConfigEntrypoint ¶
SetConfigEntrypoint sets the list of arguments to use as the command to execute when the container starts.
func (*Generator) SetConfigUser ¶
SetConfigUser sets the username or UID which the process in the container should run as.
func (*Generator) SetConfigWorkingDir ¶
SetConfigWorkingDir sets the current working directory of the entrypoint process in the container.
func (*Generator) SetCreated ¶
SetCreated sets the combined date and time at which the image was created.
func (*Generator) SetOS ¶
SetOS sets the name of the operating system which the image is built to run on.
func (*Generator) SetRootfsType ¶
SetRootfsType sets the type of the rootfs.