Documentation ¶
Index ¶
- Variables
- type Builder
- type Cache
- type ContainerOperation
- type DefaultPhaseFactory
- type LifecycleExecution
- func (l *LifecycleExecution) Analyze(ctx context.Context, repoName, networkMode string, publish bool, ...) error
- func (l LifecycleExecution) AppDir() string
- func (l *LifecycleExecution) AppPath() string
- func (l *LifecycleExecution) AppVolume() string
- func (l *LifecycleExecution) Build(ctx context.Context, networkMode string, volumes []string, ...) error
- func (l *LifecycleExecution) Builder() Builder
- func (l *LifecycleExecution) Cleanup() error
- func (l *LifecycleExecution) Create(ctx context.Context, publish bool, dockerHost string, clearCache bool, ...) error
- func (l *LifecycleExecution) Detect(ctx context.Context, networkMode string, volumes []string, ...) error
- func (l *LifecycleExecution) Export(ctx context.Context, repoName, runImage string, publish bool, ...) error
- func (l *LifecycleExecution) LayersVolume() string
- func (l *LifecycleExecution) PlatformAPI() *api.Version
- func (l *LifecycleExecution) Restore(ctx context.Context, networkMode string, buildCache Cache, ...) error
- func (l *LifecycleExecution) Run(ctx context.Context, phaseFactoryCreator PhaseFactoryCreator) error
- type LifecycleExecutor
- type LifecycleOptions
- type Phase
- type PhaseConfigProvider
- func (p *PhaseConfigProvider) ContainerConfig() *container.Config
- func (p *PhaseConfigProvider) ContainerOps() []ContainerOperation
- func (p *PhaseConfigProvider) ErrorWriter() io.Writer
- func (p *PhaseConfigProvider) HostConfig() *container.HostConfig
- func (p *PhaseConfigProvider) InfoWriter() io.Writer
- func (p *PhaseConfigProvider) Name() string
- type PhaseConfigProviderOperation
- func NullOp() PhaseConfigProviderOperation
- func WithArgs(args ...string) PhaseConfigProviderOperation
- func WithBinds(binds ...string) PhaseConfigProviderOperation
- func WithContainerOperations(operations ...ContainerOperation) PhaseConfigProviderOperation
- func WithDaemonAccess(dockerHost string) PhaseConfigProviderOperation
- func WithEnv(envs ...string) PhaseConfigProviderOperation
- func WithFlags(flags ...string) PhaseConfigProviderOperation
- func WithImage(image string) PhaseConfigProviderOperation
- func WithLifecycleProxy(lifecycleExec *LifecycleExecution) PhaseConfigProviderOperation
- func WithLogPrefix(prefix string) PhaseConfigProviderOperation
- func WithNetwork(networkMode string) PhaseConfigProviderOperation
- func WithRegistryAccess(authConfig string) PhaseConfigProviderOperation
- func WithRoot() PhaseConfigProviderOperation
- type PhaseFactory
- type PhaseFactoryCreator
- type RunnerCleaner
Constants ¶
This section is empty.
Variables ¶
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 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, includeRoot bool, 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. if includeRoot is set the UID/GID will be set on the dst directory.
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 ¶
func (m *DefaultPhaseFactory) New(provider *PhaseConfigProvider) RunnerCleaner
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, networkMode string, publish bool, dockerHost string, clearCache bool, cache Cache, phaseFactory PhaseFactory) error
func (LifecycleExecution) AppDir ¶
func (l LifecycleExecution) AppDir() string
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) 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, runImage string, publish bool, dockerHost, networkMode string, buildCache, launchCache Cache, additionalTags []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, networkMode string, buildCache Cache, 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 DockerHost string CacheImage string HTTPProxy string HTTPSProxy string NoProxy string Network string AdditionalTags []string Volumes []string DefaultProcessType string FileFilter func(string) bool Workspace string GID int }
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 NullOp ¶
func NullOp() PhaseConfigProviderOperation
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(dockerHost string) 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
func WithRoot ¶
func WithRoot() PhaseConfigProviderOperation
type PhaseFactory ¶
type PhaseFactory interface {
New(provider *PhaseConfigProvider) RunnerCleaner
}
func NewDefaultPhaseFactory ¶
func NewDefaultPhaseFactory(lifecycleExec *LifecycleExecution) PhaseFactory
type PhaseFactoryCreator ¶
type PhaseFactoryCreator func(*LifecycleExecution) PhaseFactory