Documentation ¶
Index ¶
- Variables
- type Builder
- type Cache
- type ContainerOperation
- func CopyDir(src, dst string, uid, gid int, os string, includeRoot bool, ...) ContainerOperation
- func CopyOut(handler func(closer io.ReadCloser) error, srcs ...string) ContainerOperation
- func CopyOutTo(src, dest string) ContainerOperation
- func EnsureVolumeAccess(uid, gid int, os string, volumeNames ...string) ContainerOperation
- func WriteProjectMetadata(p string, metadata platform.ProjectMetadata, os string) ContainerOperation
- func WriteStackToml(dstPath string, stack builder.StackMetadata, os string) ContainerOperation
- type DefaultPhaseFactory
- type LifecycleExecution
- func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCache Cache, phaseFactory PhaseFactory) error
- func (l LifecycleExecution) AppDir() string
- func (l *LifecycleExecution) AppPath() string
- func (l *LifecycleExecution) AppVolume() string
- func (l *LifecycleExecution) Build(ctx context.Context, phaseFactory PhaseFactory) error
- func (l *LifecycleExecution) Builder() Builder
- func (l *LifecycleExecution) Cleanup() error
- func (l *LifecycleExecution) Create(ctx context.Context, buildCache, launchCache Cache, phaseFactory PhaseFactory) error
- func (l *LifecycleExecution) Detect(ctx context.Context, phaseFactory PhaseFactory) error
- func (l *LifecycleExecution) Export(ctx context.Context, buildCache, launchCache Cache, phaseFactory PhaseFactory) error
- func (l *LifecycleExecution) Extend(ctx context.Context, buildCache Cache, phaseFactory PhaseFactory) error
- func (l *LifecycleExecution) ImageName() name.Reference
- func (l *LifecycleExecution) LayersVolume() string
- func (l *LifecycleExecution) PlatformAPI() *api.Version
- func (l *LifecycleExecution) PrevImageName() string
- func (l *LifecycleExecution) Restore(ctx context.Context, buildCache Cache, phaseFactory PhaseFactory) 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) Handler() pcontainer.Handler
- func (p *PhaseConfigProvider) HostConfig() *container.HostConfig
- func (p *PhaseConfigProvider) InfoWriter() io.Writer
- func (p *PhaseConfigProvider) Name() string
- func (p *PhaseConfigProvider) PostContainerRunOps() []ContainerOperation
- type PhaseConfigProviderOperation
- func If(expression bool, operation PhaseConfigProviderOperation) 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 WithPostContainerRunOperations(operations ...ContainerOperation) PhaseConfigProviderOperation
- func WithRegistryAccess(authConfig string) PhaseConfigProviderOperation
- func WithRoot() PhaseConfigProviderOperation
- type PhaseFactory
- type PhaseFactoryCreator
- type RunnerCleaner
- type Termui
Constants ¶
This section is empty.
Variables ¶
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"), api.MustParse("0.5"), api.MustParse("0.6"), api.MustParse("0.7"), api.MustParse("0.8"), api.MustParse("0.9"), api.MustParse("0.10"), } )
Functions ¶
This section is empty.
Types ¶
type ContainerOperation ¶ added in v0.12.0
type ContainerOperation func(ctrClient client.CommonAPIClient, ctx context.Context, containerID string, stdout, stderr io.Writer) error
func CopyDir ¶ added in v0.12.0
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 CopyOut ¶ added in v0.23.0
func CopyOut(handler func(closer io.ReadCloser) error, srcs ...string) ContainerOperation
CopyOut copies container directories to a handler function. The handler is responsible for closing the Reader.
func CopyOutTo ¶ added in v0.24.0
func CopyOutTo(src, dest string) ContainerOperation
func EnsureVolumeAccess ¶ added in v0.14.0
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 WriteProjectMetadata ¶ added in v0.21.0
func WriteProjectMetadata(p string, metadata platform.ProjectMetadata, os string) ContainerOperation
WriteProjectMetadata
func WriteStackToml ¶ added in v0.12.0
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 ¶ added in v0.10.0
type DefaultPhaseFactory struct {
// contains filtered or unexported fields
}
func (*DefaultPhaseFactory) New ¶ added in v0.10.0
func (m *DefaultPhaseFactory) New(provider *PhaseConfigProvider) RunnerCleaner
type LifecycleExecution ¶ added in v0.13.0
type LifecycleExecution struct {
// contains filtered or unexported fields
}
func NewLifecycleExecution ¶ added in v0.13.0
func NewLifecycleExecution(logger logging.Logger, docker client.CommonAPIClient, opts LifecycleOptions) (*LifecycleExecution, error)
func (*LifecycleExecution) Analyze ¶ added in v0.13.0
func (l *LifecycleExecution) Analyze(ctx context.Context, buildCache, launchCache Cache, phaseFactory PhaseFactory) error
func (LifecycleExecution) AppDir ¶ added in v0.19.0
func (l LifecycleExecution) AppDir() string
func (*LifecycleExecution) AppPath ¶ added in v0.13.0
func (l *LifecycleExecution) AppPath() string
func (*LifecycleExecution) AppVolume ¶ added in v0.13.0
func (l *LifecycleExecution) AppVolume() string
func (*LifecycleExecution) Build ¶ added in v0.13.0
func (l *LifecycleExecution) Build(ctx context.Context, phaseFactory PhaseFactory) error
func (*LifecycleExecution) Builder ¶ added in v0.13.0
func (l *LifecycleExecution) Builder() Builder
func (*LifecycleExecution) Cleanup ¶ added in v0.13.0
func (l *LifecycleExecution) Cleanup() error
func (*LifecycleExecution) Create ¶ added in v0.13.0
func (l *LifecycleExecution) Create(ctx context.Context, buildCache, launchCache Cache, phaseFactory PhaseFactory) error
func (*LifecycleExecution) Detect ¶ added in v0.13.0
func (l *LifecycleExecution) Detect(ctx context.Context, phaseFactory PhaseFactory) error
func (*LifecycleExecution) Export ¶ added in v0.13.0
func (l *LifecycleExecution) Export(ctx context.Context, buildCache, launchCache Cache, phaseFactory PhaseFactory) error
func (*LifecycleExecution) Extend ¶ added in v0.28.0
func (l *LifecycleExecution) Extend(ctx context.Context, buildCache Cache, phaseFactory PhaseFactory) error
func (*LifecycleExecution) ImageName ¶ added in v0.22.0
func (l *LifecycleExecution) ImageName() name.Reference
func (*LifecycleExecution) LayersVolume ¶ added in v0.13.0
func (l *LifecycleExecution) LayersVolume() string
func (*LifecycleExecution) PlatformAPI ¶ added in v0.13.0
func (l *LifecycleExecution) PlatformAPI() *api.Version
func (*LifecycleExecution) PrevImageName ¶ added in v0.22.0
func (l *LifecycleExecution) PrevImageName() string
func (*LifecycleExecution) Restore ¶ added in v0.13.0
func (l *LifecycleExecution) Restore(ctx context.Context, buildCache Cache, phaseFactory PhaseFactory) error
func (*LifecycleExecution) Run ¶ added in v0.13.0
func (l *LifecycleExecution) Run(ctx context.Context, phaseFactoryCreator PhaseFactoryCreator) error
type LifecycleExecutor ¶ added in v0.13.0
type LifecycleExecutor struct {
// contains filtered or unexported fields
}
func NewLifecycleExecutor ¶ added in v0.13.0
func NewLifecycleExecutor(logger logging.Logger, docker client.CommonAPIClient) *LifecycleExecutor
func (*LifecycleExecutor) Execute ¶ added in v0.13.0
func (l *LifecycleExecutor) Execute(ctx context.Context, opts LifecycleOptions) error
type LifecycleOptions ¶
type LifecycleOptions struct { AppPath string Image name.Reference Builder Builder BuilderImage string // differs from Builder.Name() and Builder.Image().Name() in that it includes the registry context LifecycleImage string RunImage string ProjectMetadata platform.ProjectMetadata ClearCache bool Publish bool TrustBuilder bool UseCreator bool Interactive bool Termui Termui DockerHost string Cache cache.CacheOpts CacheImage string HTTPProxy string HTTPSProxy string NoProxy string Network string AdditionalTags []string Volumes []string DefaultProcessType string FileFilter func(string) bool Workspace string GID int PreviousImage string SBOMDestinationDir string CreationTime *time.Time }
type PhaseConfigProvider ¶ added in v0.10.0
type PhaseConfigProvider struct {
// contains filtered or unexported fields
}
func NewPhaseConfigProvider ¶ added in v0.10.0
func NewPhaseConfigProvider(name string, lifecycleExec *LifecycleExecution, ops ...PhaseConfigProviderOperation) *PhaseConfigProvider
func (*PhaseConfigProvider) ContainerConfig ¶ added in v0.10.0
func (p *PhaseConfigProvider) ContainerConfig() *container.Config
func (*PhaseConfigProvider) ContainerOps ¶ added in v0.12.0
func (p *PhaseConfigProvider) ContainerOps() []ContainerOperation
func (*PhaseConfigProvider) ErrorWriter ¶ added in v0.11.0
func (p *PhaseConfigProvider) ErrorWriter() io.Writer
func (*PhaseConfigProvider) Handler ¶ added in v0.21.0
func (p *PhaseConfigProvider) Handler() pcontainer.Handler
func (*PhaseConfigProvider) HostConfig ¶ added in v0.10.0
func (p *PhaseConfigProvider) HostConfig() *container.HostConfig
func (*PhaseConfigProvider) InfoWriter ¶ added in v0.11.0
func (p *PhaseConfigProvider) InfoWriter() io.Writer
func (*PhaseConfigProvider) Name ¶ added in v0.10.0
func (p *PhaseConfigProvider) Name() string
func (*PhaseConfigProvider) PostContainerRunOps ¶ added in v0.23.0
func (p *PhaseConfigProvider) PostContainerRunOps() []ContainerOperation
type PhaseConfigProviderOperation ¶ added in v0.10.0
type PhaseConfigProviderOperation func(*PhaseConfigProvider)
func If ¶ added in v0.23.0
func If(expression bool, operation PhaseConfigProviderOperation) PhaseConfigProviderOperation
func NullOp ¶ added in v0.16.0
func NullOp() PhaseConfigProviderOperation
func WithArgs ¶
func WithArgs(args ...string) PhaseConfigProviderOperation
func WithBinds ¶
func WithBinds(binds ...string) PhaseConfigProviderOperation
func WithContainerOperations ¶ added in v0.12.0
func WithContainerOperations(operations ...ContainerOperation) PhaseConfigProviderOperation
func WithDaemonAccess ¶
func WithDaemonAccess(dockerHost string) PhaseConfigProviderOperation
func WithEnv ¶ added in v0.11.0
func WithEnv(envs ...string) PhaseConfigProviderOperation
func WithFlags ¶ added in v0.12.0
func WithFlags(flags ...string) PhaseConfigProviderOperation
WithFlags differs from WithArgs as flags are always prepended
func WithImage ¶ added in v0.11.0
func WithImage(image string) PhaseConfigProviderOperation
func WithLifecycleProxy ¶ added in v0.10.0
func WithLifecycleProxy(lifecycleExec *LifecycleExecution) PhaseConfigProviderOperation
func WithLogPrefix ¶ added in v0.11.0
func WithLogPrefix(prefix string) PhaseConfigProviderOperation
WithLogPrefix sets a prefix for logs produced by this phase
func WithNetwork ¶
func WithNetwork(networkMode string) PhaseConfigProviderOperation
func WithPostContainerRunOperations ¶ added in v0.23.0
func WithPostContainerRunOperations(operations ...ContainerOperation) PhaseConfigProviderOperation
func WithRegistryAccess ¶
func WithRegistryAccess(authConfig string) PhaseConfigProviderOperation
func WithRoot ¶
func WithRoot() PhaseConfigProviderOperation
type PhaseFactory ¶ added in v0.10.0
type PhaseFactory interface {
New(provider *PhaseConfigProvider) RunnerCleaner
}
func NewDefaultPhaseFactory ¶ added in v0.10.0
func NewDefaultPhaseFactory(lifecycleExec *LifecycleExecution) PhaseFactory
type PhaseFactoryCreator ¶ added in v0.14.0
type PhaseFactoryCreator func(*LifecycleExecution) PhaseFactory