core

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Min_Recipe_Version = []uint8{1, 0, 0}

Functions

func BuildContainerfile

func BuildContainerfile(recipe *api.Recipe) error

Generate a Containerfile from the recipe

func BuildModule

func BuildModule(recipe *api.Recipe, moduleInterface interface{}) ([]string, error)

Build a command string for the given module in the recipe

func BuildRecipe

func BuildRecipe(recipePath string) (api.Recipe, error)

Load and build a Containerfile from the specified recipe

func BuildShellModule added in v0.2.1

func BuildShellModule(moduleInterface interface{}, recipe *api.Recipe) (string, error)

Build shell module commands and return them as a single string

Returns: Concatenated shell commands or an error if any step fails

func ChangeWorkingDirectory added in v0.7.3

func ChangeWorkingDirectory(workdir string, containerfile *os.File) error

Add a WORKDIR instruction to the containerfile

func CompileRecipe added in v0.2.4

func CompileRecipe(recipePath string, runtime string, isRoot bool, origGid int, origUid int) error

Compile and build the recipe using the specified runtime

func GenModule added in v0.2.0

func GenModule(modulePath string) (map[string]interface{}, error)

GenModule generate a Module struct from a module path

func GetContainerStorage added in v0.8.0

func GetContainerStorage(runtime string) (cstorage.Store, error)

Retrieve the container storage configuration based on the runtime

func GetImageID added in v0.8.0

func GetImageID(name string, store cstorage.Store) (string, error)

Retrieve the image ID for a given image name from the storage

func GetTopLayerID added in v0.8.0

func GetTopLayerID(imageid string, store cstorage.Store) (string, error)

Retrieve the top layer ID for a given image ID from the storage

func LoadRecipe

func LoadRecipe(path string) (*api.Recipe, error)

LoadRecipe loads a recipe from a file and returns a Recipe Does not validate the recipe but it will catch some errors a proper validation will be done in the future

func MountImage added in v0.8.0

func MountImage(imagename string, imageid string, runtime string) (string, error)

Mount the image and return the mount directory

func RestoreWorkingDirectory added in v0.7.3

func RestoreWorkingDirectory(workdir string, containerfile *os.File) error

Add a WORKDIR instruction to reset to the root directory

func TestRecipe added in v0.5.0

func TestRecipe(path string) (*api.Recipe, error)

TestRecipe validates a recipe by loading it and checking for errors

Types

type Finalize added in v0.8.0

type Finalize struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Content []byte // The entire module unparsed as a []byte, used by plugins
}

Configuration for finalization steps

type IncludesModule added in v0.3.2

type IncludesModule struct {
	Name     string   `json:"name"`
	Type     string   `json:"type"`
	Includes []string `json:"includes"`
}

Configuration for including other modules or recipes

type Module

type Module struct {
	Name    string `json:"name"`
	Workdir string
	Type    string `json:"type"`
	Modules []map[string]interface{}
	Content []byte // The entire module unparsed as a []byte, used by plugins
}

Configuration for a module

type ModuleCommand

type ModuleCommand struct {
	Name    string
	Command []string
	Workdir string
}

Information for building a module

func BuildModules

func BuildModules(recipe *api.Recipe, modules []interface{}) ([]ModuleCommand, error)

Build commands for each module in the recipe

type Plugin added in v0.3.2

type Plugin struct {
	Name         string
	BuildFunc    func(*C.char, *C.char) string
	LoadedPlugin uintptr
	PluginInfo   api.PluginInfo
}

Configuration for a plugin

type ShellModule added in v0.3.2

type ShellModule struct {
	Name     string `json:"name"`
	Type     string `json:"type"`
	Sources  []api.Source
	Commands []string
}

Configuration for shell modules

type StorageConf added in v0.8.0

type StorageConf struct {
	Driver    string
	Runroot   string
	Graphroot string
}

Configuration for storage drivers

Jump to

Keyboard shortcuts

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