step

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: Apache-2.0 Imports: 28 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Add        = Directive("ADD")
	Cmd        = Directive("CMD")
	Copy       = Directive("COPY")
	Entrypoint = Directive("ENTRYPOINT")
	Env        = Directive("ENV")
	Expose     = Directive("EXPOSE")
	From       = Directive("FROM")
	Label      = Directive("LABEL")
	Maintainer = Directive("MAINTAINER")
	Run        = Directive("RUN")
	User       = Directive("USER")
	Volume     = Directive("VOLUME")
	Workdir    = Directive("WORKDIR")
)

Set of all valid directives.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddStep

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

AddStep is similar to copy, so they depend on a common base.

func AddStepFixture

func AddStepFixture(args string, srcs []string, dst string, commit bool) *AddStep

AddStepFixture returns a AddStep, panicing if it fails, for testing purposes.

func AddStepFixtureNoChown

func AddStepFixtureNoChown(args string, srcs []string, dst string, commit bool) *AddStep

AddStepFixtureNoChown returns a AddStep, panicing if it fails, for testing purposes.

func NewAddStep

func NewAddStep(args, chown string, fromPaths []string, toPath string, commit bool) (*AddStep, error)

NewAddStep creates a new AddStep

func (AddStep) ContextDirs

func (s AddStep) ContextDirs() (string, []string)

ContextDirs returns the stage and directories that a 'COPY --from=<stage>' depends on.

func (AddStep) Execute

func (s AddStep) Execute(ctx *context.BuildContext, modifyFS bool) (err error)

Execute executes the add/copy step. If modifyFS is true, actually performs the on-disk copy.

func (AddStep) RequireOnDisk

func (s AddStep) RequireOnDisk() bool

RequireOnDisk returns true if the add/copy has a chown argument, as we need to read the users file to translate user/group name to uid/gid.

func (AddStep) SetCacheID

func (s AddStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Calculates the ID randomly if copying from another stage, else checksums the file contents.

type BuildStep

type BuildStep interface {
	String() string

	// RequireOnDisk returns whether executing this step requires on-disk state.
	RequireOnDisk() bool

	// ContextDirs returns directories that this step requires from another stage.
	ContextDirs() (string, []string)

	// CacheID returns the step's cache id after it is set using SetCacheID().
	CacheID() string

	// SetCacheID sets the cache ID of the step given a seed value.
	SetCacheID(ctx *context.BuildContext, seed string) error

	// ApplyConfig sets up the execution environment using image config from previous step.
	// This function will not be skipped.
	ApplyConfig(ctx *context.BuildContext, imageConfig *image.Config) error

	// Execute executes the step. If modifyFS is true, the command might change the local
	// file system.
	Execute(ctx *context.BuildContext, modifyFS bool) error

	// Commit generates an image layer.
	Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

	// GenerateConfig generates a new image config base on config from previous step.
	// This function will not be skipped.
	GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

	// HasCommit returns whether or not a particular commit step has a commit annotation.
	HasCommit() bool
}

BuildStep performs build for one build step.

func NewCmdStep

func NewCmdStep(args string, cmd []string, commit bool) BuildStep

NewCmdStep returns a BuildStep given ParsedLine.

func NewDockerfileStep

func NewDockerfileStep(
	ctx *context.BuildContext, d dockerfile.Directive, seed string) (BuildStep, error)

NewDockerfileStep initializes a build step from a dockerfile directive.

func NewEntrypointStep

func NewEntrypointStep(args string, entrypoint []string, commit bool) BuildStep

NewEntrypointStep returns a BuildStep from give build step.

func NewEnvStep

func NewEnvStep(args string, envs map[string]string, commit bool) BuildStep

NewEnvStep returns a BuildStep from give build step.

func NewExposeStep

func NewExposeStep(args string, ports []string, commit bool) BuildStep

NewExposeStep returns a BuildStep from give build step.

func NewLabelStep

func NewLabelStep(args string, labels map[string]string, commit bool) BuildStep

NewLabelStep returns a BuildStep from give build step.

func NewMaintainerStep

func NewMaintainerStep(args string, author string, commit bool) BuildStep

NewMaintainerStep returns a BuildStep from give build step.

func NewUserStep

func NewUserStep(args, user string, commit bool) BuildStep

NewUserStep returns a BuildStep from give build step.

func NewVolumeStep

func NewVolumeStep(args string, volumes []string, commit bool) BuildStep

NewVolumeStep returns a BuildStep from give build step.

func NewWorkdirStep

func NewWorkdirStep(args string, workingDir string, commit bool) BuildStep

NewWorkdirStep returns a BuildStep from give build step.

type CmdStep

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

CmdStep implements BuildStep and execute CMD directive There are three forms of command: CMD ["executable","param1","param2"] -> CmdStep.cmds = []string{`["executable","param1","param2"]`} CMD ["param1","param2"] -> CmdStep.cmds = []string{`["param1","param2"]`} CMD command param1 param2 -> CmdStep.cmds = []string{"command", "param1", "param2"}

func (CmdStep) ApplyConfig

func (s CmdStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (CmdStep) CacheID

func (s CmdStep) CacheID() string

CacheID returns the cache ID of the step.

func (CmdStep) Commit

func (s CmdStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (CmdStep) ContextDirs

func (s CmdStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (CmdStep) Execute

func (s CmdStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*CmdStep) GenerateConfig

func (s *CmdStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (CmdStep) HasCommit

func (s CmdStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (CmdStep) RequireOnDisk

func (s CmdStep) RequireOnDisk() bool

func (CmdStep) SetCacheID

func (s CmdStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (CmdStep) String

func (s CmdStep) String() string

String returns the string representation of this step.

type CopyStep

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

CopyStep is similar to add, so they depend on a common base.

func CopyStepFixture

func CopyStepFixture(args, fromStage string, srcs []string, dst string, commit bool) *CopyStep

CopyStepFixture returns a CopyStep, panicing if it fails, for testing purposes.

func CopyStepFixtureNoChown

func CopyStepFixtureNoChown(args, fromStage string, srcs []string, dst string, commit bool) *CopyStep

CopyStepFixtureNoChown returns a CopyStep, panicing if it fails, for testing purposes.

func NewCopyStep

func NewCopyStep(args, chown, fromStage string, fromPaths []string, toPath string, commit bool) (*CopyStep, error)

NewCopyStep creates a new CopyStep.

func (CopyStep) ContextDirs

func (s CopyStep) ContextDirs() (string, []string)

ContextDirs returns the stage and directories that a 'COPY --from=<stage>' depends on.

func (CopyStep) Execute

func (s CopyStep) Execute(ctx *context.BuildContext, modifyFS bool) (err error)

Execute executes the add/copy step. If modifyFS is true, actually performs the on-disk copy.

func (CopyStep) RequireOnDisk

func (s CopyStep) RequireOnDisk() bool

RequireOnDisk returns true if the add/copy has a chown argument, as we need to read the users file to translate user/group name to uid/gid.

func (CopyStep) SetCacheID

func (s CopyStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Calculates the ID randomly if copying from another stage, else checksums the file contents.

type Directive

type Directive string

Directive represents a valid directive type.

type EntrypointStep

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

EntrypointStep implements BuildStep and execute ENTRYPOINT directive There are three forms of command: ENTRYPOINT ["executable","param1","param2"] -> EntrypointStep.entrypoint = []string{`["executable","param1","param2"]`} ENTRYPOINT ["param1","param2"] -> EntrypointStep.entrypoint = []string{`["param1","param2"]`} ENTRYPOINT command param1 param2 -> EntrypointStep.entrypoint = []string{"command", "param1", "param2"}

func (EntrypointStep) ApplyConfig

func (s EntrypointStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (EntrypointStep) CacheID

func (s EntrypointStep) CacheID() string

CacheID returns the cache ID of the step.

func (EntrypointStep) Commit

func (s EntrypointStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (EntrypointStep) ContextDirs

func (s EntrypointStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (EntrypointStep) Execute

func (s EntrypointStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*EntrypointStep) GenerateConfig

func (s *EntrypointStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (EntrypointStep) HasCommit

func (s EntrypointStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (EntrypointStep) RequireOnDisk

func (s EntrypointStep) RequireOnDisk() bool

func (EntrypointStep) SetCacheID

func (s EntrypointStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (EntrypointStep) String

func (s EntrypointStep) String() string

String returns the string representation of this step.

type EnvStep

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

EnvStep implements BuildStep and execute ENV directive

func (EnvStep) ApplyConfig

func (s EnvStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (EnvStep) CacheID

func (s EnvStep) CacheID() string

CacheID returns the cache ID of the step.

func (EnvStep) Commit

func (s EnvStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (EnvStep) ContextDirs

func (s EnvStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (EnvStep) Execute

func (s EnvStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*EnvStep) GenerateConfig

func (s *EnvStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (EnvStep) HasCommit

func (s EnvStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (EnvStep) RequireOnDisk

func (s EnvStep) RequireOnDisk() bool

func (EnvStep) SetCacheID

func (s EnvStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (EnvStep) String

func (s EnvStep) String() string

String returns the string representation of this step.

type ExposeStep

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

ExposeStep implements BuildStep and execute EXPOSE directive

func (ExposeStep) ApplyConfig

func (s ExposeStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (ExposeStep) CacheID

func (s ExposeStep) CacheID() string

CacheID returns the cache ID of the step.

func (ExposeStep) Commit

func (s ExposeStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (ExposeStep) ContextDirs

func (s ExposeStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (ExposeStep) Execute

func (s ExposeStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*ExposeStep) GenerateConfig

func (s *ExposeStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (ExposeStep) HasCommit

func (s ExposeStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (ExposeStep) RequireOnDisk

func (s ExposeStep) RequireOnDisk() bool

func (ExposeStep) SetCacheID

func (s ExposeStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (ExposeStep) String

func (s ExposeStep) String() string

String returns the string representation of this step.

type FromStep

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

FromStep implements BuildStep and execute FROM directive

func FromStepFixture

func FromStepFixture(args, image, alias string) *FromStep

FromStepFixture returns a FromStep, panicing if it fails, for testing purposes.

func NewFromStep

func NewFromStep(args, imageName, alias string) (*FromStep, error)

NewFromStep returns a BuildStep from give build step.

func (FromStep) ApplyConfig

func (s FromStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (FromStep) CacheID

func (s FromStep) CacheID() string

CacheID returns the cache ID of the step.

func (*FromStep) Commit

func (s *FromStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (FromStep) ContextDirs

func (s FromStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (*FromStep) Execute

func (s *FromStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute updates the memFS with the FROM image. If modifyFS is true, also unpacks it to the local filesystem.

func (*FromStep) GenerateConfig

func (s *FromStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (*FromStep) GetAlias

func (s *FromStep) GetAlias() string

GetAlias returns stage alias defined in From step.

func (*FromStep) GetImage

func (s *FromStep) GetImage() string

GetImage returns the image name in From step.

func (FromStep) HasCommit

func (s FromStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (FromStep) RequireOnDisk

func (s FromStep) RequireOnDisk() bool

func (*FromStep) SetCacheID

func (s *FromStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cacheID of the step using the name of the base image. TODO: Use the sha of that image instead of the image name itself.

func (FromStep) String

func (s FromStep) String() string

String returns the string representation of this step.

type LabelStep

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

LabelStep implements BuildStep and execute LABEL directive

func (LabelStep) ApplyConfig

func (s LabelStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (LabelStep) CacheID

func (s LabelStep) CacheID() string

CacheID returns the cache ID of the step.

func (LabelStep) Commit

func (s LabelStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (LabelStep) ContextDirs

func (s LabelStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (LabelStep) Execute

func (s LabelStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*LabelStep) GenerateConfig

func (s *LabelStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (LabelStep) HasCommit

func (s LabelStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (LabelStep) RequireOnDisk

func (s LabelStep) RequireOnDisk() bool

func (LabelStep) SetCacheID

func (s LabelStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (LabelStep) String

func (s LabelStep) String() string

String returns the string representation of this step.

type MaintainerStep

type MaintainerStep struct {
	Author string
	// contains filtered or unexported fields
}

MaintainerStep implements BuildStep and execute MAINTAINER directive

func (MaintainerStep) ApplyConfig

func (s MaintainerStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (MaintainerStep) CacheID

func (s MaintainerStep) CacheID() string

CacheID returns the cache ID of the step.

func (MaintainerStep) Commit

func (s MaintainerStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (MaintainerStep) ContextDirs

func (s MaintainerStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (MaintainerStep) Execute

func (s MaintainerStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*MaintainerStep) GenerateConfig

func (s *MaintainerStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (MaintainerStep) HasCommit

func (s MaintainerStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (MaintainerStep) RequireOnDisk

func (s MaintainerStep) RequireOnDisk() bool

func (MaintainerStep) SetCacheID

func (s MaintainerStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (MaintainerStep) String

func (s MaintainerStep) String() string

String returns the string representation of this step.

type RunStep

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

RunStep implements BuildStep and execute RUN directive

func NewRunStep

func NewRunStep(args, cmd string, commit bool) *RunStep

NewRunStep returns a BuildStep from give build step.

func (RunStep) ApplyConfig

func (s RunStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (RunStep) CacheID

func (s RunStep) CacheID() string

CacheID returns the cache ID of the step.

func (RunStep) Commit

func (s RunStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (RunStep) ContextDirs

func (s RunStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (*RunStep) Execute

func (s *RunStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. It shells out to run the specified command, which might change local file system.

func (RunStep) GenerateConfig

func (s RunStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step. Default implementation makes a copy of given image config.

func (RunStep) HasCommit

func (s RunStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (*RunStep) RequireOnDisk

func (s *RunStep) RequireOnDisk() bool

RequireOnDisk always returns true, as run steps always require the stage's layers to be present on disk.

func (RunStep) SetCacheID

func (s RunStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (RunStep) String

func (s RunStep) String() string

String returns the string representation of this step.

type UserStep

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

UserStep implements BuildStep and execute USER directive

func (UserStep) ApplyConfig

func (s UserStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (UserStep) CacheID

func (s UserStep) CacheID() string

CacheID returns the cache ID of the step.

func (UserStep) Commit

func (s UserStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (UserStep) ContextDirs

func (s UserStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (UserStep) Execute

func (s UserStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*UserStep) GenerateConfig

func (s *UserStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (UserStep) HasCommit

func (s UserStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (UserStep) RequireOnDisk

func (s UserStep) RequireOnDisk() bool

func (UserStep) SetCacheID

func (s UserStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (UserStep) String

func (s UserStep) String() string

String returns the string representation of this step.

type VolumeStep

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

VolumeStep implements BuildStep and execute VOLUME directive

func (VolumeStep) ApplyConfig

func (s VolumeStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (VolumeStep) CacheID

func (s VolumeStep) CacheID() string

CacheID returns the cache ID of the step.

func (VolumeStep) Commit

func (s VolumeStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (VolumeStep) ContextDirs

func (s VolumeStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (VolumeStep) Execute

func (s VolumeStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*VolumeStep) GenerateConfig

func (s *VolumeStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (VolumeStep) HasCommit

func (s VolumeStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (VolumeStep) RequireOnDisk

func (s VolumeStep) RequireOnDisk() bool

func (VolumeStep) SetCacheID

func (s VolumeStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (VolumeStep) String

func (s VolumeStep) String() string

String returns the string representation of this step.

type WorkdirStep

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

WorkdirStep implements BuildStep and execute WORKDIR directive

func (WorkdirStep) ApplyConfig

func (s WorkdirStep) ApplyConfig(
	ctx *context.BuildContext, imageConfig *image.Config) error

ApplyConfig sets up the execution environment using image config from previous step. This function will not be skipped.

func (WorkdirStep) CacheID

func (s WorkdirStep) CacheID() string

CacheID returns the cache ID of the step.

func (WorkdirStep) Commit

func (s WorkdirStep) Commit(ctx *context.BuildContext) ([]*image.DigestPair, error)

Commit generates an image layer.

func (WorkdirStep) ContextDirs

func (s WorkdirStep) ContextDirs() (string, []string)

ContextDirs returns directories that this step requires from another stage.

func (WorkdirStep) Execute

func (s WorkdirStep) Execute(ctx *context.BuildContext, modifyFS bool) error

Execute executes the step. If modifyFS is true, the command might change the local file system. Default implementation is noop.

func (*WorkdirStep) GenerateConfig

func (s *WorkdirStep) GenerateConfig(ctx *context.BuildContext, imageConfig *image.Config) (*image.Config, error)

GenerateConfig generates a new image config base on config from previous step.

func (WorkdirStep) HasCommit

func (s WorkdirStep) HasCommit() bool

HasCommit returns whether or not a particular commit step has a commit annotation.

func (WorkdirStep) RequireOnDisk

func (s WorkdirStep) RequireOnDisk() bool

func (WorkdirStep) SetCacheID

func (s WorkdirStep) SetCacheID(ctx *context.BuildContext, seed string) error

SetCacheID sets the cache ID of the step given a seed SHA256 value. Special steps like FROM, ADD, COPY have their own implementations.

func (WorkdirStep) String

func (s WorkdirStep) String() string

String returns the string representation of this step.

Jump to

Keyboard shortcuts

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