imagenie

package
v0.0.0-...-4465fd8 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const LogLevelEnv = "LOGLEVEL"

LogLevelEnv log-level environment variable name.

Variables

This section is empty.

Functions

func ReInit

func ReInit()

ReInit executes buildah steps to initialize unshare.

func SetLogLevel

func SetLogLevel()

SetLogLevel set logrus log-level based on environment variable value.

Types

type Config

type Config struct {
	FromImage   string
	BaseImage   string
	TargetImage string
}

Config primary application configuration.

type CopyPaths

type CopyPaths map[string]string

CopyPaths source directory as key, and destination as value.

type Imagenie

type Imagenie struct {
	TargetMgr *Manager // target container manager
	// contains filtered or unexported fields
}

Imagenie primary application representation.

func NewImagenie

func NewImagenie(cfg *Config) (*Imagenie, error)

NewImagenie instantiate application.

func (*Imagenie) CleanUp

func (i *Imagenie) CleanUp() error

CleanUp unmount source container, remove source and target working containers.

func (*Imagenie) Copy

func (i *Imagenie) Copy(paths CopyPaths) error

Copy loop over paths in order to copy it from source-image into destination container.

func (*Imagenie) Labels

func (i *Imagenie) Labels()

Labels inspect labels in source container, and set them in target container.

func (*Imagenie) RunAll

func (i *Imagenie) RunAll(commands []string) error

RunAll run all commands in informed slice, each entry is splitted again by spaces and executed on target container.

type Manager

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

Manager buildah based container manager.

func NewManager

func NewManager(fromImage, targetImage string) (*Manager, error)

NewManager instantiate and bootstrap manager.

func (*Manager) Add

func (m *Manager) Add(src, dst string) error

Add local path to container.

func (*Manager) Commit

func (m *Manager) Commit() error

Commit execute commit by creating a image out of container in use.

func (*Manager) Delete

func (m *Manager) Delete() error

Delete delete current container.

func (*Manager) From

func (m *Manager) From() error

From save container image, therefore subsequent changes can take place.

func (*Manager) Labels

func (m *Manager) Labels() map[string]string

Labels return a map with container labels.

func (*Manager) Mount

func (m *Manager) Mount() error

Mount the container and store the mount point path.

func (*Manager) Pull

func (m *Manager) Pull() error

Pull download image from upstream registry, saving it on local storage.

func (*Manager) Push

func (m *Manager) Push() error

Push execute push of target image.

func (*Manager) Run

func (m *Manager) Run(command []string) error

Run arbitrary commaand on container.

func (*Manager) SetCMD

func (m *Manager) SetCMD(cmd []string)

SetCMD set informed string slice as cmd.

func (*Manager) SetEntrypoint

func (m *Manager) SetEntrypoint(entrypoint []string)

SetEntrypoint set informed string slice as entrypoint.

func (*Manager) SetLabel

func (m *Manager) SetLabel(k, v string)

SetLabel set container label.

func (*Manager) Unmount

func (m *Manager) Unmount() error

Unmount container.

Jump to

Keyboard shortcuts

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