container_runtime

package
v1.2.27-fix Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerLockName

func ContainerLockName(containerName string) string

func ImageLockName

func ImageLockName(imageName string) string

func LogImageInfo added in v1.2.16

func LogImageInfo(ctx context.Context, img LegacyImageInterface, prevStageImageSize int64)

func LogImageName added in v1.2.16

func LogImageName(ctx context.Context, name string)

func ShelloutPack

func ShelloutPack(command string) string

Types

type BuildDockerfileOptions added in v1.2.26

type BuildDockerfileOptions struct {
	ContextTar           io.ReadCloser
	DockerfileCtxRelPath string // TODO: remove this and instead write the []byte dockerfile to /Dockerfile in the ContextTar inDockerServerRuntime.BuildDockerfile().
	Target               string
	BuildArgs            []string // {"key1=value1", "key2=value2", ... }
	AddHost              []string
	Network              string
	SSH                  string
	Labels               []string
	Tags                 []string
}

type BuildahImage added in v1.2.26

type BuildahImage struct {
	Image LegacyImageInterface
}

type BuildahRuntime added in v1.2.26

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

func NewBuildahRuntime added in v1.2.26

func NewBuildahRuntime(buildah buildah.Buildah) *BuildahRuntime

func (*BuildahRuntime) BuildDockerfile added in v1.2.26

func (runtime *BuildahRuntime) BuildDockerfile(ctx context.Context, dockerfile []byte, opts BuildDockerfileOptions) (string, error)

func (*BuildahRuntime) GetImageInfo added in v1.2.26

func (runtime *BuildahRuntime) GetImageInfo(ctx context.Context, ref string) (*image.Info, error)

GetImageInfo returns nil, nil if image not found.

func (*BuildahRuntime) Pull added in v1.2.26

func (runtime *BuildahRuntime) Pull(ctx context.Context, ref string) error

func (*BuildahRuntime) PullImageFromRegistry added in v1.2.26

func (runtime *BuildahRuntime) PullImageFromRegistry(ctx context.Context, img LegacyImageInterface) error

func (*BuildahRuntime) Push added in v1.2.26

func (runtime *BuildahRuntime) Push(ctx context.Context, ref string) error

func (*BuildahRuntime) RefreshImageObject added in v1.2.26

func (runtime *BuildahRuntime) RefreshImageObject(ctx context.Context, img LegacyImageInterface) error

func (*BuildahRuntime) RemoveImage added in v1.2.26

func (runtime *BuildahRuntime) RemoveImage(ctx context.Context, img LegacyImageInterface) error

func (*BuildahRuntime) RenameImage added in v1.2.26

func (runtime *BuildahRuntime) RenameImage(ctx context.Context, img LegacyImageInterface, newImageName string, removeOldName bool) error

func (*BuildahRuntime) Rmi added in v1.2.26

func (runtime *BuildahRuntime) Rmi(ctx context.Context, ref string) error

func (*BuildahRuntime) String added in v1.2.26

func (runtime *BuildahRuntime) String() string

func (*BuildahRuntime) Tag added in v1.2.26

func (runtime *BuildahRuntime) Tag(ctx context.Context, ref, newRef string) error

type ContainerRuntime

type ContainerRuntime interface {
	Tag(ctx context.Context, ref, newRef string) error
	Push(ctx context.Context, ref string) error
	Pull(ctx context.Context, ref string) error
	Rmi(ctx context.Context, ref string) error

	GetImageInfo(ctx context.Context, ref string) (*image.Info, error)
	BuildDockerfile(ctx context.Context, dockerfile []byte, opts BuildDockerfileOptions) (string, error)

	String() string

	// Legacy
	RefreshImageObject(ctx context.Context, img LegacyImageInterface) error
	PullImageFromRegistry(ctx context.Context, img LegacyImageInterface) error
	RenameImage(ctx context.Context, img LegacyImageInterface, newImageName string, removeOldName bool) error
	RemoveImage(ctx context.Context, img LegacyImageInterface) error
}

type DockerServerRuntime added in v1.2.26

type DockerServerRuntime struct{}

func NewDockerServerRuntime added in v1.2.26

func NewDockerServerRuntime() *DockerServerRuntime

func (*DockerServerRuntime) BuildDockerfile added in v1.2.26

func (runtime *DockerServerRuntime) BuildDockerfile(ctx context.Context, _ []byte, opts BuildDockerfileOptions) (string, error)

func (*DockerServerRuntime) GetImageInfo added in v1.2.26

func (runtime *DockerServerRuntime) GetImageInfo(ctx context.Context, ref string) (*image.Info, error)

func (*DockerServerRuntime) GetImageInspect added in v1.2.26

func (runtime *DockerServerRuntime) GetImageInspect(ctx context.Context, ref string) (*types.ImageInspect, error)

GetImageInspect only available for DockerServerRuntime

func (*DockerServerRuntime) Pull added in v1.2.26

func (runtime *DockerServerRuntime) Pull(ctx context.Context, ref string) error

func (*DockerServerRuntime) PullImageFromRegistry added in v1.2.26

func (runtime *DockerServerRuntime) PullImageFromRegistry(ctx context.Context, img LegacyImageInterface) error

func (*DockerServerRuntime) Push added in v1.2.26

func (runtime *DockerServerRuntime) Push(ctx context.Context, ref string) error

func (*DockerServerRuntime) PushBuiltImage added in v1.2.26

func (runtime *DockerServerRuntime) PushBuiltImage(ctx context.Context, img LegacyImageInterface) error

PushBuiltImage is only available for DockerServerRuntime

func (*DockerServerRuntime) PushImage added in v1.2.26

func (runtime *DockerServerRuntime) PushImage(ctx context.Context, img LegacyImageInterface) error

func (*DockerServerRuntime) RefreshImageObject added in v1.2.26

func (runtime *DockerServerRuntime) RefreshImageObject(ctx context.Context, img LegacyImageInterface) error

func (*DockerServerRuntime) RemoveImage added in v1.2.26

func (runtime *DockerServerRuntime) RemoveImage(ctx context.Context, img LegacyImageInterface) error

func (*DockerServerRuntime) RenameImage added in v1.2.26

func (runtime *DockerServerRuntime) RenameImage(ctx context.Context, img LegacyImageInterface, newImageName string, removeOldName bool) error

func (*DockerServerRuntime) Rmi added in v1.2.26

func (runtime *DockerServerRuntime) Rmi(ctx context.Context, ref string) error

func (*DockerServerRuntime) String added in v1.2.26

func (runtime *DockerServerRuntime) String() string

func (*DockerServerRuntime) Tag added in v1.2.26

func (runtime *DockerServerRuntime) Tag(ctx context.Context, ref, newRef string) error

func (*DockerServerRuntime) TagImageByName added in v1.2.26

func (runtime *DockerServerRuntime) TagImageByName(ctx context.Context, img LegacyImageInterface) error

TagBuiltImageByName is only available for DockerServerRuntime

type DockerfileImageBuilder

type DockerfileImageBuilder struct {
	ContainerRuntime       ContainerRuntime
	Dockerfile             []byte
	BuildDockerfileOptions BuildDockerfileOptions
	ContextArchivePath     string
	// contains filtered or unexported fields
}

func NewDockerfileImageBuilder

func NewDockerfileImageBuilder(containerRuntime ContainerRuntime) *DockerfileImageBuilder

func (*DockerfileImageBuilder) AppendAddHost added in v1.2.26

func (b *DockerfileImageBuilder) AppendAddHost(addHost ...string)

func (*DockerfileImageBuilder) AppendBuildArgs

func (b *DockerfileImageBuilder) AppendBuildArgs(args ...string)

func (*DockerfileImageBuilder) AppendLabels added in v1.2.26

func (b *DockerfileImageBuilder) AppendLabels(labels ...string)

func (*DockerfileImageBuilder) Build

filePathToStdin != "" ??

func (*DockerfileImageBuilder) Cleanup

func (b *DockerfileImageBuilder) Cleanup(ctx context.Context) error

func (*DockerfileImageBuilder) GetBuiltId

func (b *DockerfileImageBuilder) GetBuiltId() string

func (*DockerfileImageBuilder) SetContextArchivePath added in v1.2.26

func (b *DockerfileImageBuilder) SetContextArchivePath(contextArchivePath string)

func (*DockerfileImageBuilder) SetDockerfile added in v1.2.26

func (b *DockerfileImageBuilder) SetDockerfile(dockerfile []byte)

func (*DockerfileImageBuilder) SetDockerfileCtxRelPath added in v1.2.26

func (b *DockerfileImageBuilder) SetDockerfileCtxRelPath(dockerfileCtxRelPath string)

func (*DockerfileImageBuilder) SetNetwork added in v1.2.26

func (b *DockerfileImageBuilder) SetNetwork(network string)

func (*DockerfileImageBuilder) SetSSH added in v1.2.26

func (b *DockerfileImageBuilder) SetSSH(ssh string)

func (*DockerfileImageBuilder) SetTarget added in v1.2.26

func (b *DockerfileImageBuilder) SetTarget(target string)

type LegacyBuildOptions added in v1.2.26

type LegacyBuildOptions struct {
	IntrospectBeforeError bool
	IntrospectAfterError  bool
}

type LegacyBuilderContainer added in v1.2.26

type LegacyBuilderContainer 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 LegacyContainer added in v1.2.26

type LegacyContainer interface {
	Name() string

	UserRunCommands() []string
	UserCommitChanges() []string

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

	RunOptions() LegacyContainerOptions
	CommitChangeOptions() LegacyContainerOptions
	ServiceCommitChangeOptions() LegacyContainerOptions
}

type LegacyContainerOptions added in v1.2.26

type LegacyContainerOptions interface {
	AddVolume(volumes ...string)
	AddVolumeFrom(volumesFrom ...string)
	AddExpose(exposes ...string)
	AddEnv(envs map[string]string)
	AddLabel(labels map[string]string)
	AddCmd(cmd string)
	AddWorkdir(workdir string)
	AddUser(user string)
	AddEntrypoint(entrypoint string)
	AddHealthCheck(check string)
}

type LegacyImageInterface added in v1.2.26

type LegacyImageInterface interface {
	Name() string
	SetName(name string)

	Pull(ctx context.Context) error
	Push(ctx context.Context) error

	// TODO: build specifics for stapel builder and dockerfile builder
	// TODO: should be under a single separate interface
	Container() LegacyContainer
	BuilderContainer() LegacyBuilderContainer
	DockerfileImageBuilder() *DockerfileImageBuilder

	Build(context.Context, LegacyBuildOptions) error
	GetBuiltId() string
	TagBuiltImage(ctx context.Context) error

	Introspect(ctx context.Context) error

	SetInfo(info *image.Info)

	IsExistsLocally() bool

	SetStageDescription(stage *image.StageDescription)
	GetStageDescription() *image.StageDescription
}

type LegacyStageImage added in v1.2.26

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

func NewLegacyStageImage added in v1.2.26

func NewLegacyStageImage(fromImage *LegacyStageImage, name string, containerRuntime ContainerRuntime) *LegacyStageImage

func (*LegacyStageImage) Build added in v1.2.26

func (i *LegacyStageImage) Build(ctx context.Context, options LegacyBuildOptions) error

func (*LegacyStageImage) BuilderContainer added in v1.2.26

func (i *LegacyStageImage) BuilderContainer() LegacyBuilderContainer

func (*LegacyStageImage) Commit added in v1.2.26

func (i *LegacyStageImage) Commit(ctx context.Context) error

func (*LegacyStageImage) Container added in v1.2.26

func (i *LegacyStageImage) Container() LegacyContainer

func (*LegacyStageImage) DockerfileImageBuilder added in v1.2.26

func (i *LegacyStageImage) DockerfileImageBuilder() *DockerfileImageBuilder

func (*LegacyStageImage) GetBuiltId added in v1.2.26

func (i *LegacyStageImage) GetBuiltId() string

func (*LegacyStageImage) GetID added in v1.2.26

func (i *LegacyStageImage) GetID() string

func (*LegacyStageImage) GetInfo added in v1.2.26

func (i *LegacyStageImage) GetInfo() *image.Info

func (LegacyStageImage) GetStageDescription added in v1.2.26

func (i LegacyStageImage) GetStageDescription() *image.StageDescription

func (*LegacyStageImage) Introspect added in v1.2.26

func (i *LegacyStageImage) Introspect(ctx context.Context) error

func (LegacyStageImage) IsExistsLocally added in v1.2.26

func (i LegacyStageImage) IsExistsLocally() bool

func (*LegacyStageImage) MustGetBuiltId added in v1.2.26

func (i *LegacyStageImage) MustGetBuiltId() string

func (*LegacyStageImage) MustResetInfo added in v1.2.26

func (i *LegacyStageImage) MustResetInfo(ctx context.Context) error

func (LegacyStageImage) Name added in v1.2.26

func (i LegacyStageImage) Name() string

func (*LegacyStageImage) Pull added in v1.2.26

func (i *LegacyStageImage) Pull(ctx context.Context) error

func (*LegacyStageImage) Push added in v1.2.26

func (i *LegacyStageImage) Push(ctx context.Context) error

func (LegacyStageImage) SetInfo added in v1.2.26

func (i LegacyStageImage) SetInfo(info *image.Info)

func (LegacyStageImage) SetName added in v1.2.26

func (i LegacyStageImage) SetName(name string)

func (LegacyStageImage) SetStageDescription added in v1.2.26

func (i LegacyStageImage) SetStageDescription(stageDesc *image.StageDescription)

func (*LegacyStageImage) Tag added in v1.2.26

func (i *LegacyStageImage) Tag(ctx context.Context, name string) error

func (*LegacyStageImage) TagBuiltImage added in v1.2.26

func (i *LegacyStageImage) TagBuiltImage(ctx context.Context) error

func (LegacyStageImage) UnsetInfo added in v1.2.26

func (i LegacyStageImage) UnsetInfo()

type LegacyStageImageBuilderContainer added in v1.2.26

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

func (*LegacyStageImageBuilderContainer) AddEnv added in v1.2.26

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

func (*LegacyStageImageBuilderContainer) AddExpose added in v1.2.26

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

func (*LegacyStageImageBuilderContainer) AddLabel added in v1.2.26

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

func (*LegacyStageImageBuilderContainer) AddRunCommands added in v1.2.26

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

func (*LegacyStageImageBuilderContainer) AddServiceRunCommands added in v1.2.26

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

func (*LegacyStageImageBuilderContainer) AddVolume added in v1.2.26

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

func (*LegacyStageImageBuilderContainer) AddVolumeFrom added in v1.2.26

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

type LegacyStageImageContainer added in v1.2.26

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

func (*LegacyStageImageContainer) AddRunCommands added in v1.2.26

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

func (*LegacyStageImageContainer) AddServiceRunCommands added in v1.2.26

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

func (*LegacyStageImageContainer) CommitChangeOptions added in v1.2.26

func (c *LegacyStageImageContainer) CommitChangeOptions() LegacyContainerOptions

func (*LegacyStageImageContainer) Name added in v1.2.26

func (*LegacyStageImageContainer) RunOptions added in v1.2.26

func (*LegacyStageImageContainer) ServiceCommitChangeOptions added in v1.2.26

func (c *LegacyStageImageContainer) ServiceCommitChangeOptions() LegacyContainerOptions

func (*LegacyStageImageContainer) UserCommitChanges added in v1.2.26

func (c *LegacyStageImageContainer) UserCommitChanges() []string

func (*LegacyStageImageContainer) UserRunCommands added in v1.2.26

func (c *LegacyStageImageContainer) UserRunCommands() []string

type LegacyStageImageContainerOptions added in v1.2.26

type LegacyStageImageContainerOptions struct {
	Volume      []string
	VolumesFrom []string
	Expose      []string
	Env         map[string]string
	Label       map[string]string
	Cmd         string
	Workdir     string
	User        string
	Entrypoint  string
	HealthCheck string
}

func (*LegacyStageImageContainerOptions) AddCmd added in v1.2.26

func (co *LegacyStageImageContainerOptions) AddCmd(cmd string)

func (*LegacyStageImageContainerOptions) AddEntrypoint added in v1.2.26

func (co *LegacyStageImageContainerOptions) AddEntrypoint(entrypoint string)

func (*LegacyStageImageContainerOptions) AddEnv added in v1.2.26

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

func (*LegacyStageImageContainerOptions) AddExpose added in v1.2.26

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

func (*LegacyStageImageContainerOptions) AddHealthCheck added in v1.2.26

func (co *LegacyStageImageContainerOptions) AddHealthCheck(check string)

func (*LegacyStageImageContainerOptions) AddLabel added in v1.2.26

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

func (*LegacyStageImageContainerOptions) AddUser added in v1.2.26

func (co *LegacyStageImageContainerOptions) AddUser(user string)

func (*LegacyStageImageContainerOptions) AddVolume added in v1.2.26

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

func (*LegacyStageImageContainerOptions) AddVolumeFrom added in v1.2.26

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

func (*LegacyStageImageContainerOptions) AddWorkdir added in v1.2.26

func (co *LegacyStageImageContainerOptions) AddWorkdir(workdir string)

type PerfCheckContainerRuntime added in v1.2.26

type PerfCheckContainerRuntime struct {
	ContainerRuntime ContainerRuntime
}

func NewPerfCheckContainerRuntime added in v1.2.26

func NewPerfCheckContainerRuntime(containerRuntime ContainerRuntime) *PerfCheckContainerRuntime

func (*PerfCheckContainerRuntime) BuildDockerfile added in v1.2.26

func (runtime *PerfCheckContainerRuntime) BuildDockerfile(ctx context.Context, dockerfile []byte, opts BuildDockerfileOptions) (resID string, resErr error)

func (*PerfCheckContainerRuntime) GetImageInfo added in v1.2.26

func (runtime *PerfCheckContainerRuntime) GetImageInfo(ctx context.Context, ref string) (resImg *image.Info, resErr error)

func (*PerfCheckContainerRuntime) Pull added in v1.2.26

func (runtime *PerfCheckContainerRuntime) Pull(ctx context.Context, ref string) (resErr error)

func (*PerfCheckContainerRuntime) PullImageFromRegistry added in v1.2.26

func (runtime *PerfCheckContainerRuntime) PullImageFromRegistry(ctx context.Context, img LegacyImageInterface) (resErr error)

func (*PerfCheckContainerRuntime) Push added in v1.2.26

func (runtime *PerfCheckContainerRuntime) Push(ctx context.Context, ref string) (resErr error)

func (*PerfCheckContainerRuntime) RefreshImageObject added in v1.2.26

func (runtime *PerfCheckContainerRuntime) RefreshImageObject(ctx context.Context, img LegacyImageInterface) (resErr error)

func (*PerfCheckContainerRuntime) RemoveImage added in v1.2.26

func (runtime *PerfCheckContainerRuntime) RemoveImage(ctx context.Context, img LegacyImageInterface) (resErr error)

func (*PerfCheckContainerRuntime) RenameImage added in v1.2.26

func (runtime *PerfCheckContainerRuntime) RenameImage(ctx context.Context, img LegacyImageInterface, newImageName string, removeOldName bool) (resErr error)

func (*PerfCheckContainerRuntime) Rmi added in v1.2.26

func (runtime *PerfCheckContainerRuntime) Rmi(ctx context.Context, ref string) (resErr error)

func (*PerfCheckContainerRuntime) String added in v1.2.26

func (runtime *PerfCheckContainerRuntime) String() string

func (*PerfCheckContainerRuntime) Tag added in v1.2.26

func (runtime *PerfCheckContainerRuntime) Tag(ctx context.Context, ref, newRef string) (resErr error)

Jump to

Keyboard shortcuts

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