build

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2021 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SupportedPlatformAPIVersions lists the Platform API versions pack supports listed from earliest to latest
	SupportedPlatformAPIVersions = builder.APISet{
		api.MustParse("0.3"),
		api.MustParse("0.4"),
	}
)

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Name() string
	UID() int
	GID() int
	LifecycleDescriptor() builder.LifecycleDescriptor
	Stack() builder.StackMetadata
	Image() imgutil.Image
}

type Cache

type Cache interface {
	Name() string
	Clear(context.Context) error
}

type ContainerOperation

type ContainerOperation func(ctrClient client.CommonAPIClient, ctx context.Context, containerID string, stdout, stderr io.Writer) error

func CopyDir

func CopyDir(src, dst string, uid, gid int, os string, fileFilter func(string) bool) ContainerOperation

CopyDir copies a local directory (src) to the destination on the container while filtering files and changing it's UID/GID.

func EnsureVolumeAccess

func EnsureVolumeAccess(uid, gid int, os string, volumeNames ...string) ContainerOperation

EnsureVolumeAccess grants full access permissions to volumes for UID/GID-based user When UID/GID are 0 it grants explicit full access to BUILTIN\Administrators and any other UID/GID grants full access to BUILTIN\Users Changing permissions on volumes through stopped containers does not work on Docker for Windows so we start the container and make change using icacls See: https://github.com/moby/moby/issues/40771

func WriteStackToml

func WriteStackToml(dstPath string, stack builder.StackMetadata, os string) ContainerOperation

WriteStackToml writes a `stack.toml` based on the StackMetadata provided to the destination path.

type DefaultPhaseFactory

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

func (*DefaultPhaseFactory) New

type LifecycleExecution

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

func NewLifecycleExecution

func NewLifecycleExecution(logger logging.Logger, docker client.CommonAPIClient, opts LifecycleOptions) (*LifecycleExecution, error)

func (*LifecycleExecution) Analyze

func (l *LifecycleExecution) Analyze(ctx context.Context, repoName, cacheName, networkMode string, publish, clearCache bool, phaseFactory PhaseFactory) error

func (*LifecycleExecution) AppPath

func (l *LifecycleExecution) AppPath() string

func (*LifecycleExecution) AppVolume

func (l *LifecycleExecution) AppVolume() string

func (*LifecycleExecution) Build

func (l *LifecycleExecution) Build(ctx context.Context, networkMode string, volumes []string, phaseFactory PhaseFactory) error

func (*LifecycleExecution) Builder

func (l *LifecycleExecution) Builder() Builder

func (*LifecycleExecution) Cleanup

func (l *LifecycleExecution) Cleanup() error

func (*LifecycleExecution) Create

func (l *LifecycleExecution) Create(
	ctx context.Context,
	publish, clearCache bool,
	runImage, launchCacheName, cacheName, repoName, networkMode string,
	volumes []string,
	phaseFactory PhaseFactory,
) error

func (*LifecycleExecution) Detect

func (l *LifecycleExecution) Detect(ctx context.Context, networkMode string, volumes []string, phaseFactory PhaseFactory) error

func (*LifecycleExecution) Export

func (l *LifecycleExecution) Export(ctx context.Context, repoName string, runImage string, publish bool, launchCacheName, cacheName, networkMode string, phaseFactory PhaseFactory) error

func (*LifecycleExecution) LayersVolume

func (l *LifecycleExecution) LayersVolume() string

func (*LifecycleExecution) PlatformAPI

func (l *LifecycleExecution) PlatformAPI() *api.Version

func (*LifecycleExecution) Restore

func (l *LifecycleExecution) Restore(ctx context.Context, cacheName, networkMode string, phaseFactory PhaseFactory) error

func (*LifecycleExecution) Run

func (l *LifecycleExecution) Run(ctx context.Context, phaseFactoryCreator PhaseFactoryCreator) error

type LifecycleExecutor

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

func NewLifecycleExecutor

func NewLifecycleExecutor(logger logging.Logger, docker client.CommonAPIClient) *LifecycleExecutor

func (*LifecycleExecutor) Execute

func (l *LifecycleExecutor) Execute(ctx context.Context, opts LifecycleOptions) error

type LifecycleOptions

type LifecycleOptions struct {
	AppPath            string
	Image              name.Reference
	Builder            Builder
	LifecycleImage     string
	RunImage           string
	ClearCache         bool
	Publish            bool
	TrustBuilder       bool
	UseCreator         bool
	HTTPProxy          string
	HTTPSProxy         string
	NoProxy            string
	Network            string
	Volumes            []string
	DefaultProcessType string
	FileFilter         func(string) bool
}

type Phase

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

func (*Phase) Cleanup

func (p *Phase) Cleanup() error

func (*Phase) Run

func (p *Phase) Run(ctx context.Context) error

type PhaseConfigProvider

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

func NewPhaseConfigProvider

func NewPhaseConfigProvider(name string, lifecycleExec *LifecycleExecution, ops ...PhaseConfigProviderOperation) *PhaseConfigProvider

func (*PhaseConfigProvider) ContainerConfig

func (p *PhaseConfigProvider) ContainerConfig() *container.Config

func (*PhaseConfigProvider) ContainerOps

func (p *PhaseConfigProvider) ContainerOps() []ContainerOperation

func (*PhaseConfigProvider) ErrorWriter

func (p *PhaseConfigProvider) ErrorWriter() io.Writer

func (*PhaseConfigProvider) HostConfig

func (p *PhaseConfigProvider) HostConfig() *container.HostConfig

func (*PhaseConfigProvider) InfoWriter

func (p *PhaseConfigProvider) InfoWriter() io.Writer

func (*PhaseConfigProvider) Name

func (p *PhaseConfigProvider) Name() string

type PhaseConfigProviderOperation

type PhaseConfigProviderOperation func(*PhaseConfigProvider)

func WithArgs

func WithArgs(args ...string) PhaseConfigProviderOperation

func WithBinds

func WithBinds(binds ...string) PhaseConfigProviderOperation

func WithContainerOperations

func WithContainerOperations(operations ...ContainerOperation) PhaseConfigProviderOperation

func WithDaemonAccess

func WithDaemonAccess() PhaseConfigProviderOperation

func WithEnv

func WithEnv(envs ...string) PhaseConfigProviderOperation

func WithFlags

func WithFlags(flags ...string) PhaseConfigProviderOperation

WithFlags differs from WithArgs as flags are always prepended

func WithImage

func WithImage(image string) PhaseConfigProviderOperation

func WithLifecycleProxy

func WithLifecycleProxy(lifecycleExec *LifecycleExecution) PhaseConfigProviderOperation

func WithLogPrefix

func WithLogPrefix(prefix string) PhaseConfigProviderOperation

WithLogPrefix sets a prefix for logs produced by this phase

func WithNetwork

func WithNetwork(networkMode string) PhaseConfigProviderOperation

func WithRegistryAccess

func WithRegistryAccess(authConfig string) PhaseConfigProviderOperation

type PhaseFactory

type PhaseFactory interface {
	New(provider *PhaseConfigProvider) RunnerCleaner
}

func NewDefaultPhaseFactory

func NewDefaultPhaseFactory(lifecycleExec *LifecycleExecution) PhaseFactory

type PhaseFactoryCreator

type PhaseFactoryCreator func(*LifecycleExecution) PhaseFactory

type RunnerCleaner

type RunnerCleaner interface {
	Run(ctx context.Context) error
	Cleanup() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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