image

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2018 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const StageContainerNamePrefix = "dapp.build."

Variables

This section is empty.

Functions

func ImageCommand

func ImageCommand(args map[string]interface{}, command func(stageImage *Stage) error) (map[string]interface{}, error)

func ShelloutPack

func ShelloutPack(command string) string

Types

type BuildOptions

type BuildOptions struct {
	IntrospectBeforeError bool
	IntrospectAfterError  bool
}

type BuilderContainer

type BuilderContainer interface {
	AddServiceRunCommands(commands ...string)
	AddRunCommands(commands ...string)

	AddVolume(volumes ...string)
	AddVolumeFrom(volumesFrom ...string)
	AddExpose(exposes ...string)
	AddEnv(envs map[string]string)
	AddLabel(labels map[string]string)
}

type CmdStage

type CmdStage struct {
	From                 *CmdStage              `json:"from"`
	Name                 string                 `json:"name"`
	ContainerName        string                 `json:"container_name"`
	BuiltId              string                 `json:"built_id"`
	BashCommands         []string               `json:"bash_commands"`
	ServiceBashCommands  []string               `json:"service_bash_commands"`
	Options              *StageContainerOptions `json:"options"`
	ChangeOptions        *StageContainerOptions `json:"change_options"`
	ServiceChangeOptions *StageContainerOptions `json:"service_change_options"`
	ImageInspect         *types.ImageInspect    `json:"image_inspect"`
	BuiltImageInspect    *types.ImageInspect    `json:"built_image_inspect"`
}

type Container added in v1.2.223

type Container interface {
	Name() string

	AddServiceRunCommands(commands ...string)
	AddRunCommands(commands ...string)

	RunOptions() ContainerOptions
	CommitChangeOptions() ContainerOptions
	ServiceCommitChangeOptions() ContainerOptions
}

type ContainerOptions

type ContainerOptions interface {
	AddVolume(volumes ...string)
	AddVolumeFrom(volumesFrom ...string)
	AddExpose(exposes ...string)
	AddEnv(envs map[string]string)
	AddLabel(labels map[string]string)
	AddCmd(cmds ...string)
	AddOnbuild(onbuilds ...string)
	AddWorkdir(workdir string)
	AddUser(user string)
	AddEntrypoint(entrypoints ...string)
	AddStopSignal(signal string)
	AddHealthCheck(check string)
}

type Dimg

type Dimg struct {
	*Stage
}

func NewDimgImage

func NewDimgImage(fromImage *Stage, name string) *Dimg

func (*Dimg) Export

func (i *Dimg) Export() error

func (Dimg) GetInspect

func (i Dimg) GetInspect() (*types.ImageInspect, error)

func (Dimg) Name

func (i Dimg) Name() string

func (Dimg) ResetInspect

func (i Dimg) ResetInspect() error

func (*Dimg) Tag

func (i *Dimg) Tag() error

func (Dimg) Untag

func (i Dimg) Untag() error

type Image

type Image interface {
	Name() string
	Labels() map[string]string
	ID() string

	Container() Container
	BuilderContainer() BuilderContainer

	IsExists() bool

	SyncDockerState() error

	Pull() error

	SaveInCache() error

	Build(BuildOptions) error
}

type Stage

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

func NewStageImage

func NewStageImage(fromImage *Stage, name string) *Stage

func (*Stage) Build

func (i *Stage) Build(options BuildOptions) error

func (*Stage) BuilderContainer

func (i *Stage) BuilderContainer() BuilderContainer

func (*Stage) Commit

func (i *Stage) Commit() error

func (*Stage) Container

func (i *Stage) Container() Container

func (*Stage) Export

func (i *Stage) Export(name string) error

func (Stage) GetInspect

func (i Stage) GetInspect() (*types.ImageInspect, error)

func (*Stage) ID

func (i *Stage) ID() string

func (*Stage) Import

func (i *Stage) Import(name string) error

func (*Stage) Introspect

func (i *Stage) Introspect() error

func (*Stage) IsExists

func (i *Stage) IsExists() bool

func (*Stage) Labels

func (i *Stage) Labels() map[string]string

func (*Stage) MustGetId

func (i *Stage) MustGetId() (string, error)

func (*Stage) MustGetInspect

func (i *Stage) MustGetInspect() (*types.ImageInspect, error)

func (Stage) Name

func (i Stage) Name() string

func (*Stage) Pull

func (i *Stage) Pull() error

func (*Stage) Push

func (i *Stage) Push() error

func (Stage) ResetInspect

func (i Stage) ResetInspect() error

func (*Stage) SaveInCache

func (i *Stage) SaveInCache() error

func (*Stage) SyncDockerState

func (i *Stage) SyncDockerState() error

func (*Stage) Tag

func (i *Stage) Tag(name string) error

func (Stage) Untag

func (i Stage) Untag() error

type StageBuilderContainer

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

func (*StageBuilderContainer) AddEnv

func (c *StageBuilderContainer) AddEnv(envs map[string]string)

func (*StageBuilderContainer) AddExpose

func (c *StageBuilderContainer) AddExpose(exposes ...string)

func (*StageBuilderContainer) AddLabel

func (c *StageBuilderContainer) AddLabel(labels map[string]string)

func (*StageBuilderContainer) AddRunCommands

func (c *StageBuilderContainer) AddRunCommands(commands ...string)

func (*StageBuilderContainer) AddServiceRunCommands

func (c *StageBuilderContainer) AddServiceRunCommands(commands ...string)

func (*StageBuilderContainer) AddVolume

func (c *StageBuilderContainer) AddVolume(volumes ...string)

func (*StageBuilderContainer) AddVolumeFrom

func (c *StageBuilderContainer) AddVolumeFrom(volumesFrom ...string)

type StageContainer

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

func (*StageContainer) AddRunCommands

func (c *StageContainer) AddRunCommands(commands ...string)

func (*StageContainer) AddServiceRunCommands

func (c *StageContainer) AddServiceRunCommands(commands ...string)

func (*StageContainer) CommitChangeOptions

func (c *StageContainer) CommitChangeOptions() ContainerOptions

func (*StageContainer) Name

func (c *StageContainer) Name() string

func (*StageContainer) RunOptions

func (c *StageContainer) RunOptions() ContainerOptions

func (*StageContainer) ServiceCommitChangeOptions

func (c *StageContainer) ServiceCommitChangeOptions() ContainerOptions

type StageContainerOptions

type StageContainerOptions struct {
	Volume      []string          `json:"volume"`
	VolumesFrom []string          `json:"volumes-from"`
	Expose      []string          `json:"expose"`
	Env         map[string]string `json:"env"`
	Label       map[string]string `json:"label"`
	Cmd         []string          `json:"cmd"`
	Onbuild     []string          `json:"onbuild"`
	Workdir     string            `json:"workdir"`
	User        string            `json:"user"`
	Entrypoint  []string          `json:"entrypoint"`
	StopSignal  string
	HealthCheck string
}

func (*StageContainerOptions) AddCmd

func (co *StageContainerOptions) AddCmd(cmds ...string)

func (*StageContainerOptions) AddEntrypoint

func (co *StageContainerOptions) AddEntrypoint(entrypoints ...string)

func (*StageContainerOptions) AddEnv

func (co *StageContainerOptions) AddEnv(envs map[string]string)

func (*StageContainerOptions) AddExpose

func (co *StageContainerOptions) AddExpose(exposes ...string)

func (*StageContainerOptions) AddHealthCheck

func (co *StageContainerOptions) AddHealthCheck(check string)

func (*StageContainerOptions) AddLabel

func (co *StageContainerOptions) AddLabel(labels map[string]string)

func (*StageContainerOptions) AddOnbuild

func (co *StageContainerOptions) AddOnbuild(onbuilds ...string)

func (*StageContainerOptions) AddStopSignal

func (co *StageContainerOptions) AddStopSignal(signal string)

func (*StageContainerOptions) AddUser

func (co *StageContainerOptions) AddUser(user string)

func (*StageContainerOptions) AddVolume

func (co *StageContainerOptions) AddVolume(volumes ...string)

func (*StageContainerOptions) AddVolumeFrom

func (co *StageContainerOptions) AddVolumeFrom(volumesFrom ...string)

func (*StageContainerOptions) AddWorkdir

func (co *StageContainerOptions) AddWorkdir(workdir string)

Jump to

Keyboard shortcuts

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